Template:LiveCountdown/doc

LiveCountdown is a template used to displays a live countdown according to a routine cycle.

LiveCountdownBox is a template used to displays the live countdown in a right-side box.

Syntax
routine

routine
 * - A SkyRoutine definition using.

Additional parameters for LiveCountdownBox:
 * - A title string at the top of a countdown box. Optional.
 * - A subtitle string below the title. Optional, default "Event countdown".

When using multiple LiveCountdownBox stacked on each other, to prevent misalignment of each widget, it is recommended to wrap them inside MultiCountdown. Shown below:

SkyRoutine Syntax
SkyRoutine is a custom class that handles transactions of a routine. It is responsible for parsing the routine input, and load and handle events.

A SkyRoutine is written in the following syntax: A[...] C[...] L[...] U[...], where:

SkyRoutine can trace the number of would-have executions before the browser run the code, and inserts itself into the correct state. The anchor date can be set anytime in the past. If the anchor date is in the future, SkyRoutine will wait until the anchor date to execute the first time.

Locale
A locale determines the length of time measuring units. Both SkyDuration and SkyDate support specification of locale at the end of the input string. Current supported locales are: For example, "7y 6d -S" means 7 Years and 6 Days in SBST. "D6 M9 2000 00:00 -U" means September 6, 2000 in UTC.
 * UTC (Coordinated Universal Time). Specification: -U
 * SBST (SkyBlock Standard Time). Specification: -S

SkyDate Syntax
SkyDate is a custom class which represents a date. Fields in the date can be defined with components in any order and are case insensitive. For example, Y2019 M6 D12 17:00 -U is the same as 17:00 D12 Jun Y2019 -U.

A SkyDate can be defined through a UTC date or a SBST date: A trailing specification can be added (if not specified, locale is SBST).

All fields in the date can be optionally defined. The values will be determined by the table below:

Therefore, for an exact, non-changing date representation, the year must be specified.

SkyDuration Syntax
SkyDuration is a custom class which represents a duration. Fields in the duration can be defined with components in any order and are case insensitive. For example, 2y 3mo 1d 3h 2m 50s -U is the same as 50S 2M 3H 1D 3Mo 2Y -U.

A SkyDuration can be defined through UTC units or SBST units: A trailing specification can be added (if not specified, SBST units will be used).

Examples
The following cycle definitions are explained in pseudo code (code for human reading). These are some helpful reading tips:
 * while : defines a while loop. It means "Loop the following block of code, but before each loop, only proceed to a loop if is valid - else, go to the next line after that block of code."
 * while True: means "Loop the following block of code indefinitely."

Example 1
A[D27 LAU Y89 -S] C[12h -S / 12h -S]
 * SkyRoutine
 * Defines a Cycle of


 * Produces the countdown

Example 2
A[D27 LAU Y89 -S] C[12h -S / 12h -S] L[100] U[D27 EWI Y500 -S]
 * SkyRoutine
 * Defines a Cycle of


 * Produces the countdown

Example 3
A[D27 LAU Y200 03:00 -S] C[3h -S / 11h -S / 3h -S / 7h -S]
 * SkyRoutine
 * Defines a Cycle of


 * Produces the countdown