This page is currently under construction - it will be completed soon!
Time Codes
A gHost dashboard is made up of multiple widgets. By default, a widget will use the time range specified in the user's Start and End timebars at the top of the gHost site in their browser. However, this behaviour can be changed by an authorised administrator on a per-widget basis. This allows widgets to be created which can be bound to specific points in time (i.e. 01-January-2020), or to points in time which are relative to the user's current timebar selections (i.e. the beginning of the month that the user has selected).
Time-Relative Keywords
These are keywords which refer to specific dates in the year. Time-relative keywords are placed inside single {curly braces}.
| Code | Explanation |
|---|---|
| {som} | First day of the month |
| {eom} | Last day of the month |
| {soy} | First month of the year |
| {eoy} | Last month of the year |
| {sow} | First day of the week |
| {sofy} | First day of the financial year |
| {eofy} | Last day of the financial year |
| {soq} | First month of the quarter |
| {eoq} | Last month of the quarter |
Times of Day/Units of Time Keywords
These are keywords which refer to specific parts of the day, or to units of time themselves. Times of Day & Units of Time keywords are palced inside single [square brackets].
| Code | Explanation |
|---|---|
| [midnight] | 12AM (in the site's timezone) of the selected date |
| [midday] | 12PM (in the site's timezone) of the selected date |
| [oob] | 9AM (in the site's timezone) of the selected date (a.k.a 'open of business') |
| [cob] | 5PM (in the site's timezone) of the selected date (a.k.a 'close of business') |
| [<+/-><1-∞>s] | Add or subtract a number of seconds from the currently-selected (or evaluated) time |
| [<+/-><1-∞>m] | Add or subtract a number of minutes from the currently-selected (or evaluated) time |
| [<+/-><1-∞>h] | Add or subtract a number of hours from the currently-selected (or evaluated) time |
| [<+/-><1-∞>d] | Add or subtract a number of days from the currently-selected (or evaluated) time |
| [<+/-><1-∞>w] | Add or subtract a number of weeks from the currently-selected (or evaluated) time |
| [<+/-><1-∞>mo] | Add or subtract a number of months from the currently-selected (or evaluated) time |
| [<+/-><1-∞>y] | Add or subtract a number of years from the currently-selected (or evaluated) time |
Combining Keywords
Time-relative keywords do not necessarily set the hours, minutes, seconds etc. back to 0. For example, using {soy} for a widget's configuration will set the widget's start or end time to whatever the currently selected hours, minutes, and seconds are, on January 1st. Sometimes, in order to achieve the desired result (as in the 'midnight of the new year' example), multiple keywords must be combined.
When multiple keywords are combined, a regex used by the gHost system will process the combination using the following order of evaluation:
- Double square brackets
- Curly braces
- Square brackets
While keywords can be entered into a widget's configuration box in any order, they will always be evaluated by the regex in that order. For readability purposes, it is suggested to enter them according to the order of evaluation.
Example Combinations
Data from the start of the beginning of the month in the 'End' timebar, until the 'End' time
Start Bar: [[end]]{som}[midnight]
End Bar: [[end]]
Data from the start of the quarter, until the end time selected by the user
Start Bar: [[end]]{soq}{som}[midnight]
End Bar: [[end]]
Data from the start of the financial year, until the end time selected by the user
Start Bar: [[end]]{sofy}[midnight]
End Bar: [[end]]
Data from midday on the third day of the quarter, until midday of the third day before the end time selected by the user
Start Bar: [[end]]{soq}[midday][+2d]
End Bar: [[end]][midday][-3d]