The User Guide for Xin Calendar Mods
Introduction
Many times I was asked to add this or that feature to the calendar script, some of these requested features were quite essential such as date range checking, and some were just optional such as long date format.
However, each user has his own needs for a calendar script, features critical to this user might be just wastes to another. I realized that an all-in-one calendar is not going to work very well for all the users, and I should code the calendar in a way that each user will be able to pick the desired calendar features exactly, and thus comes the Xin Calendar Mods.
Xin Calendar Mods is a collection of the core scripts and their mod scripts. The core scripts are the revised and trimmed versions of the Xin Calendar scripts, they provide the basic calendar function (aka, pops up to pick a date and you can change the calendar style), additional calendar features, such as date range checking, are coded as separated mod scripts.
When an user embeds the calendar to his web page, he will include the core script and the mod scripts he needs, and use the function calls provided by mod scripts to tailor his calendar.
See these two links for examples:
- Month/Year List Mod
- Date Tips Mod
- Special Days Mod
Download the zip file: cal_core_lite.zip
Core scripts
Just like we have In-Page calendar (cal.js), Popup Window calendar (cal2.js) and In-Page Pro calendar (cal4.js) in Xin Calendar, we have the counterpart core scripts in Xin Calendar Mods:
In-Page Core (cal_core.js)
the core script for in-page calendars, comes with the following basic function calls (please refer to Xin Calendar User Guide for details on these function calls) :
The In-Page Core supports multiple static calendars as well.
Popup Window Core (cal2_core.js)
the core script for popup window calendars, comes with the following basic function calls:
In-Page Pro Core (cal4_core.js)
the core script for in-page calendars with advanced styling features, comes with the following basic function calls:
Available Mods
Currently we have the following mod features:
enables date range checking for the core scripts, comes with the following function calls:
supports date format like "Wednesday, March 20, 2003", comes with the following function call:
supports two digit years in date format, comes with the following function call:
lets you define the month/year title in your own format, comes with the following function call:
lets you use selection lists for month/year scrolling, comes with the following function call:
lets you define links for dates and load/popup the link page when you click on a date, comes with the following function calls:
lets you load/popup a page when click on a date, the page is named according to the date format, comes with the following function calls:
pops up a tip box when you hover a date, comes with the following function calls:
use different colors for special days:
Not all the mod features are available to all the core scripts, and for the same mod feature, the mod script might be implemented separated for different core scripts. The following table shows the availability:
| In-Page (cal_core.js) |
Popup Window (cal2_core.js) |
In-Page Pro (cal4_core.js) |
|
| Date Range | mod_date.js | ||
| Long Date Format | mod_long.js | ||
| Two Digit Years | mod_yy.js | ||
| Calendar Title | mod_title.js | ||
| Month/Year List | mod_list.js | n/a | |
| Date Link | mod_link.js | n/a | mod4_link.js |
| Journal | mod_journal.js | n/a | mod_journal.js |
| Date Tips | mod_tips.js | n/a | mod4_tips.js |
| Special Days | mod_days.js | mod2_days.js | mod4_days.js |
Click on a mod script to see its usage page.
Mod interference
Some mod features can be combined together, but some can't. And some features need special attention when combined. The following table shows the mod interference:
| [1] | [2] | [3] | [4] | [5] | [6] | [7] | [8] | [9] | |
| Date Range [1] | + | + | |||||||
| Long Date Format [2] | + | × | + | + | |||||
| Two Digit Years [3] | + | × | + | + | |||||
| Calendar Title [4] | × | ||||||||
| Month/Year List [5] | × | ||||||||
| Date Link [6] | + | + | × | | | ||||
| Journal [7] | × | ||||||||
| Date Tips [8] | + | + | | ||||||
| Special Days [9] | |
| × | : can not be used together |
| + | : see mod usage page for more details |
| | : the one included later will define the cell style for special dates |