-HTML CODE:
-------------------------------->
-------------------------------->
-------------------------------->
-EVENTS.JS CODE:
-------------------------------->
var evnt1 = new CalendarEvent(2000,12,25);
evnt1.name = "Christmas Day";
evnt1.time = "All Day";
evnt1.location = "Everywhere";
evnt1.description = "Christmas Carols and Presents";
evnt1.addEvent();
-------------------------------->
-------------------
*Events Explained
-------------------
You must make an event. Then manipulate it's attributes directly. Any .js file may contain event entries. Each event must end with a .addEvent(); call to put it into a list for the calendar to use.
The originial idea was to put all events in a single file...
You may do something like this if you wish... but you will have to go in a manually change the include calls whenever you want... where each .js file lives in the same diretory as the page calling it...
-------------------
*Library Explained
-------------------
from top of file to bottom:: better off to read through the documented calendar file itself
-- You have the option of hard coding a colorscheme into the calender. Defined in the top of the file and implemented in CSS. This should be self-explanitory when you look at the top of the file.
-- General Date Knowledge: the names of the months, days of the week, etc... so that you may easily adapt to a different language...
-- An Event: you make an event by (1) declaring it (2) setting its values (3) adding it to a list of events...
(1)
var event1 = new CalenderEvent(2000,1,01); //--> 4 digit year, 1-2 digit month, 1-2 digit day
(2)
event1.name = 'name of event string';
event1.time = 'time the event is going to happen';
event1.location = 'location event is happening';
event1.description = 'description of event';
(3)
event1.addEvent();
The file 'events.js' or any file you choose must contain code in the above form for as many events as you wish. They must all be entered by hand. Any event files must be loaded -after- calendar.js has been loaded.
-- The CalendarMonth itself: months are numbered from 1->12
three ways to make a calendar.
(1) the most useful way... gets current month and year from viewer's computer (as does all javascript)
var newCal = new CaledarMonth();
newCal.displayMonth();
(2) you may specify a year:
var newCal = new CaledarMonth(2001);
newCal.displayMonth();
(3) you may specify both year and month: december 2001
var newCal = new CaledarMonth(2001,12);
newCal.displayMonth();
-- You may manipulate the months as so...
var newCal = new CaledarMonth();
newCal.lastYear(); // moves the calender one year back
newCal.changeYear(-1); // moves the calender one year back
newCal.changeYear(-2); // moves the calender two years back
newCal.nextYear(); // moves the calender one year ahead
newCal.changeYear(1); // moves the calender one year ahead
newCal.changeYear(2); // moves the calender two years ahead
newCal.lastMonth(); // moves the calender one month back
newCal.changeMonth(-1); // moves the calender one month back
newCal.changeMonth(-2); // moves the calender two months back
newCal.nextMonth(); // moves the calender one month ahead
newCal.changeMonth(1); // moves the calender one month ahead
newCal.changeMonth(2); // moves the calender two months ahead
newCal.yesterday(); // moves the calender one day back
newCal.changeDay(-1); // moves the calender one day back
newCal.changeDay(-2); // moves the calender two days back
newCal.tomorrow(); // moves the calender one day ahead
newCal.changeDay(1); // moves the calender one months ahead
newCal.changeDay(2); // moves the calender two months ahead
newCal.displayMonth(); // writes calendar to the screen
-- popupDay -- only called by calendar itself, but you may if you wish
opens a new window and diplays a single day's events
popupDay( YYYYMMDD );
-- popupWeek -- only called by calendar itself, but you may if you wish
opens a new window and diplays a single week's events
popupDay( year, month, day of week the month starts on sun->sat, first legal day of week 1->31, last legal day of week 1->31 );
-- popupMonth -- only called by calendar itself, but you may if you wish
opens a new window and diplays all of a month's events
popupDay( year, month, day of the week the month starts on sun->sat );
-DONE!!
-->