I've a phoneGap build project, that open a specific page everyday by taking date value from phone.
Its like one year's full todo list is written down on 365 pages and i want to show one page everyday that matches present day's date.
I've 365 HTML pages like 1.html 2.html so on.. when user opens the app, it should check the date and open matching html page accordingly.
For ex: if today's date is Jan 1st, when user open app it must open 1.html. if its Jan two it must open 2.html and so on.
I've tried this:
document.addEventListener('DOMContentLoaded', function() {
open() }, false);
function open(){
window.open ('1.html','_self',false);
}
it wont work and i don't know How to keep today's date value in a variable, compare it and pass result to open specific page accordingly.
Can someone help me how to achieve this? should i use arrays? or if statements? please help.. Much appreciated .