Testing the DOM output code.
This commit is contained in:
parent
83d8a5cb30
commit
00857ee003
1 changed files with 14 additions and 5 deletions
19
index.html
19
index.html
|
@ -1,6 +1,7 @@
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Calendar generator</title>
|
<title>Calendar generator</title>
|
||||||
|
<meta charset="utf-8"></meta>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="input">
|
<div id="input">
|
||||||
|
@ -47,13 +48,21 @@
|
||||||
// 1st
|
// 1st
|
||||||
|
|
||||||
if (validateDate(startDate) && validateNumber(numberOfDays) && validateCountry(countryCode)){
|
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
|
//Start loop
|
||||||
for (var i = 0; i < numberOfDays; i++){
|
for (var i = 0; i < numberOfDays; i++){
|
||||||
console.log(i);
|
var output = document.getElementById("output");
|
||||||
|
var weekRow = document.createElement("div");
|
||||||
var startYear = parseInt(startDate.substr(0,4));
|
weekRow.innerHTML = "TEST";
|
||||||
var startMonth = parseInt(startDate.substr(5,2));
|
output.appendChild(weekRow);
|
||||||
var startDay = parseInt(startDate.substr(8,2));
|
|
||||||
//TODO: use getDay() to get the week's Sunday (getDay() == 0)
|
//TODO: use getDay() to get the week's Sunday (getDay() == 0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue