Xin Calendar 2 Mods: Time

     

With the Time mod, we can have time in the date string. The time format can be 24 hours or 12 hours with AM/PM, for example:

xcDateFormat="yyyy-mm-dd hr:mi";
xcDateFormat="yyyy-mm-dd hr:mi am";
xcDateFormat="yyyy-mm-dd hr:mi:ss";

To turn it on:

xcMods=[...
        {"order": 1,  "mod": "Time",              "script": "mod_time.js"}];

or:

<script language="javascript" src="../config/xc2_default.js"></script>
<script language="javascript">
  xcDateFormat="yyyy-mm-dd hr:mi am";
  xcMods[9].order=1;
</script>

Since we use select lists to pick up the time (hour, minute and AM/PM) and the block of select lists will be placed at foot bar, we usually turn off other foot links to make room for it:

<script language="javascript" src="../config/xc2_default.js"></script>
<script language="javascript">
  xcFootTagSwitch=[0, 0, 0, 0, 0, 0, 0, 0];
</script>

and the Time mod will append the block of select lists as a customized foot link.


The Time mod has some default settings in the default config file (config/xc2_default.js):

xcHours=["01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]; // for AM/PM setting
xcMinutes=["00", "05", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55"]; // simplified
xcSeconds=["00", "05", "10", "15", "20", "25", "30", "35", "40", "45", "50", "55"]; // simplified
xcAMPM=["AM", "PM"]; // to be used when "am" presents in date format
xcTimeBlockOrder=1; // foot link order for time block
xcCSSTimeBlock=["","",""]; // CSS classes for the block of select lists, ["mouse-out", "mouse-over", "mouse-down"]
xcCSSTimeList="time_list"; // CSS class for the select list

and the CSS definition of "time_list" in the default CSS file (css/xc2_default.css):

.time_list {
  font-family:verdana;
  font-size:12px;
}

When a date is picked already and the calendar is re-opened, changes of time in calendar popup will reflect on the date field. And since other foot links are usually turned off to keep a simple look, we can re-pick the same date to close the calendar (in-page version) or just close the popup window (window version).

[Putting mods together] [Back to index page]