Code:
// This is the Database of Upcoming Events
// Please Edit with Care.
//
// 8 Fields (surrounded by brackets[]) are used for EACH event:
// ["Recurring", "Month", "Day", "Year", "StartTime", "EndTime", "Name", "Description"]
// Each event field must be be surrounded by quotation marks followed by a comma ("",) EXCEPT the "Description" field.
// The "Description" field is surrounded by quotation marks only ("").
//
// Each event has a comma after the closing bracket IF another event is below it on the next line down.
// Note: The last event in this file should NOT have a comma after the closing bracket
//
// The Recurring field uses:
// "D" = Daily; "W" = Weekly; "M" = Monthly; "Y" = Yearly; "F" = Floating Holiday
//
// One Time only events should leave the Recurring field blank
// (ex. "")
//
// Daily events do NOT require that anything be in the Month Day and Year fields
// Everything in the Month Day and Year fields will be ignored
//
// Weekly events should have the day of the week field set to 1 - 7
// 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thurday, 6=Friday, 7=Saturday
//
// "F"loating events uses:
// the Month field for the Month.
// the Day field as the Cardinal Occurrence
// 1=1st, 2=2nd, 3=3rd, 4=4th, 5=5th, 6=6th occurrence of the day listed next
// the Year field as the Day of the week the event/holiday falls on
// 1=Sunday, 2=Monday, 3=Tuesday, 4=Wednesday, 5=Thurday, 6=Friday, 7=Saturday
// example: "F", "1", "3", "2", = Floating holiday in January on the 3rd Monday of that month.
//
// Note: Easter has it's own special formula so Please don't change anything related to Easter below
//
// "Y"early events are specific dates that never change - the Year field is ignored
// example - Christmas is: "12","25","",
events = new Array(
["", "11", "14", "2009", "12 november", "21 december", "Luc Standaert", "Kraainem, Oud Pachthof, individuele tentoonstelling"],
["", "10", "3", "2009", "3 oktober", "6 december", "Sam Dillemans", "Antwerpen, Napelsstraat 32, individuele tentoonstelling"],
["", "02", "6", "2010", "6 februari", "31 maart", "Luc Standaert", "Turnhout, Het Verschil (Otterstraat), individuele tentoonstelling"]
// Please omit the final comma after the ] from the last line above unless you are going to add another event at this time.
);
events[0].days=10;
events[2].days=4;
function Days(ary){
for (var nary=[],fld,z0=0;z0<ary.length;z0++){
fld=ary[z0];
fld.days=fld.days||0;
for (var cy=fld[3]*1,cm=fld[1]-1,day,d=fld[2]*1+1,na,z0a=1;z0a<fld.days;z0a++){
na=[];
na[0]=fld[0];
var lday=new Date(cy,cm+1,1,-1).getDate();
day=d++;
if (day>new Date(cy,cm+1,1,-1).getDate()){
d=day=1;
cm++;
if (cm==12){
cm=0;
cy++;
}
}
na[1]=(cm>8?'':'0')+(cm+1);
na[2]=(day>9?'':'0')+day;
na[3]=cy+'';
for (var z0b=4;z0b<fld.length;z0b++){
na.push(fld[z0b]);
}
nary.push(na);
}
}
for (var z1=0;z1<nary.length;z1++){
ary.push(nary[z1]);
}
}
Days(events);
Bookmarks