Using the dates array in EpochThe dates array forms the core of Epoch, containing all important dates, holidays, and events. Users familiar with the free Epoch version may wonder what happened to the selectedDates array. The dates array in Epoch replaces the function of selectedDates. Overviewdates is an array contains all dates of importance for Epoch. Dates of importance include any date that is not the default standard, non-selected date. Use dates to specify dates that are holidays, have custom HTML/titles, are not selectable, or are otherwise important to the user. selectedDates is an array containing all dates that are currently selected in Epoch. It is a simple pointer array; each element is a pointer to a date in the dates array—it is updated automatically whenever a date is selected/deselected. Because of the complex nature of date handling in Epoch, we strongly recommend you do not add or remove dates from dates or selectedDates using the push(), pop(), or any other array methods. Instead, use Epoch's addDates(), selectDates(), removeDates(), and resetSelections() methods. A few additions to the dates stored in datesTo allow the extra features in Epoch, a few modifications have been made to the dates that reside in the dates array, namely the addition of several extra properties. These are: canSelectA boolean (true/false) value – whether this date's calendar cell may be selected. selectedA boolean (true/false) value – whether this date's calendar cell is currently selected. typeA string (can be 'normal', or 'holiday') value – if a date is a 'holiday', its calendar cell will have a different color (which you can specify in epoch_styles.css). titleA string (can be any text) value – contains the HTML title (or tooltip) that displays when the user hovers their mouse cursor over this date's calendar cell. You can use this to give hints or brief information about this date to the user. hrefA string (can be any text) value containing a URL for this date. A cell that has a date with a URL will have a hyperlink over the day of the month—you can choose to make it a traditional link (i.e. when the user clicks on the day number only), or a JavaScript link (user clicks anywhere in the cell). See the setURL() entry in the CalCell Object entry for more details. cellHTMLA string (can be any text) value – contains any HTML you want to display under the date number in this date's calendar cell. Since by default Epoch's caledar cells are quite small, we recommend you change the default size of the calendar cells by modifying epoch_styles.css. Adding Dates to the dates ArrayAdding and removing dates to Epoch is quick and painless using the addDates() and removeDates() methods. Using addDates()
Removing Dates from EpochUsing removeDates()
Resetting the dates ArrayResetting the dates array is easy; you can:
|