-------------- OVERVIEW ------------------------------------------- The Javascript Timer module provides a timer api that can hook html elements to javascript widget objects. This is useful if you want a moving timer/clock or a widget that updates every second. It comes with widgets for a countdown timer, a countup timer, and a clock. -------------- INSTALLING ----------------------------------------- Simply by activating the module and a widget. There are no module dependencies. There are no table components. -------------- GENERAL USAGE ----------------------------------------- You can either build-up your own nested Countdown timer (with interval specified in seconds): Countdown timer with output format number setting: Count up timer: NASA style down/up timer: SVG Clock: HTML Canvas Clock: -------------- PHP Input Format Examples -------------- Countdown timer: 'jst_timer', 'widget_args' => array( 'datetime' => '2015-05-02T08:11:00-08:00' ) )); ?> Countdown timer with output format number setting: 'jst_timer', 'widget_args' => array( 'datetime' => '2015-05-02T08:11:00-08:00', 'format_num' => 2, ) )); ?> Count up timer: 'jst_timer', 'widget_args' => array( 'datetime' => '2010-05-02T08:11:00+02:00', 'dir'=>'up' ) )); ?> NASA style down/up timer: 'jst_timer', 'widget_args' => array( 'datetime' => '2015-05-02T08:11:00+02:00', 'dir'=>'up', 'format_txt' => '%sign%%hours%::%mins%::%secs%' ) )); ?> Clock Widget: 'jst_clock', 'widget_args' => array( 'clock_type' => 2, 'size' => 200 ) )); ?> -------------- Timer widget OUTPUT FORMAT --------------------------------------- The display of the actual timer is configurable in the Site configuration admin menu: countdowntimer. IMPORTANT: If you have a format_num and a format_txt in a timer, the format_txt value will trump the format_num value. Currently supported replacement values are: Target date replacements: %day% - Day number of target date (0-31) %month% - Month number of target date (1-12) %year% - Year number of target date (2013) %dow% - Day-Of-Week (Mon-Sun) %moy% - Month-Of-Year (Jan-Dec) Duration/Interval replacements: %years% - Years from set date (ex:2013, integer number) %ydays% - (Days - Years) from set date(integer number) %days% - Total Days from set date (integer number) %hours% - (Hours - Days) from set date (integer number, zero padded) %hours_nopad% - (Hours - Days) from set date (integer number, no padding) %mins% - (Minutes - Hours) from set date (intger number, zero padded) %mins_nopad% - (Minutes - Hours) from set date (intger number, no padding) %secs% - (Seconds - Minutes) from set date (integer number, zero padded) %secs_nopad% - (Seconds - Minutes) from set date (integer number, no padding) %months% - (Months - Years) from set date, will be 11 or less (integer number) %tot_months% - Total months from set date, can be larger than 11 (integer number) %tot_hours% - Total hours from set date, can be larger than 23 (integer number) %tot_minutes% - Total minutes from set date, can be larger than 59 (integer number) %tot_seconds% - Total seconds from set date, can be larger than 59 (integer number) %sign% - Is used for NASA style countdown, will be '-' before set date and '' after set date (blank or '-') -------------- CAVEATS --------------------------------------------- If a daylight saving time shift should occur in either the client's tz or the target's tz between the current date/time and your target datetime, you could be off by one hour until you pass the point of conversion. If you use the PHP input format beware. If you have a syntax or other PHP error and you've put your code in a block visible on all pages your entire site may go down and you'll need to edit your database directly to delete that block!