From 00857ee00325275646b7265dc0fa19e29b0f4621 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Sol=C3=ADs?= Date: Thu, 3 Aug 2017 18:29:27 -0600 Subject: [PATCH] Testing the DOM output code. --- index.html | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 80d5469..f8a258a 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,7 @@ Calendar generator +
@@ -47,13 +48,21 @@ // 1st if (validateDate(startDate) && validateNumber(numberOfDays) && validateCountry(countryCode)){ + + var startYear = parseInt(startDate.substr(0,4)); + var startMonth = parseInt(startDate.substr(5,2)); + var startDay = parseInt(startDate.substr(8,2)); + + var currentYear = startYear; + var currentMonth = startMonth; + var currentDay = startDay; + //Start loop for (var i = 0; i < numberOfDays; i++){ - console.log(i); - - var startYear = parseInt(startDate.substr(0,4)); - var startMonth = parseInt(startDate.substr(5,2)); - var startDay = parseInt(startDate.substr(8,2)); + var output = document.getElementById("output"); + var weekRow = document.createElement("div"); + weekRow.innerHTML = "TEST"; + output.appendChild(weekRow); //TODO: use getDay() to get the week's Sunday (getDay() == 0) } }