Forum Moderators: open
What I've figured out so far is to create a .js page for each month and then create an array for each day of that month. The javascript gets the current day/month, then calls the appropriate month. Once the month page has been called it then checks the day and pulls that text.
Although I get the gist of how it works, I'd still prefer to find something to modify since my experience with javascript is limited.
You make a good point about using SS instead of javascript. If this weren't being used in an ebook I'd stick with PHP/MySQL.
OnToday=new Array(
'2005-03-01,march 1st',
'2005-03-04,today #1',
'2005-03-05,tomorrow',
'2005-03-04,today #2',
''
);
Now=new Date();
Now_M=Now.getMonth()*1+1; // Jan-Dec = 1-12
Now_D=Now.getDate(); // 1-31
Now_Y=Now.getYear();
if (Now_Y < 70) { Now_Y=Now_Y*1+2000; }
if (Now_Y < 1900) { Now_Y=Now_Y*1+1900; }
if (Now_M < 10) { Now_M='0'+Now_M; } // leading zero?
if (Now_D < 10) { Now_D='0'+Now_D; }
Today=''+Now_Y+'-'+Now_M+'-'+Now_D;
for (i=0; i<OnToday.length; i++) {
Item=OnToday[i];
ItemDate=Item.substring(0,10);
ItemRest=Item.substring(11);
if (ItemDate == Today) {
document.write(ItemRest+'<br \/>\n');
}
}
Frankly, I hadn't considered the reason for the lack of 'on this day' javascripts to be file size related, but it does make sense.