instants
instants
#
Instants on a page, shown in the reader's own time zone.
- Ship. An instant leaves Python as its ISO form, never formatted: in
markup as
<time class="cg-instant">(label_html), in a component's data as{"instant": iso}(label_json). - Show. The script every page carries in its head (
markup.LOCAL) definescgLocal(iso)andcgText(label)for component scripts and rewrites everycg-instantelement once the page has loaded, so a page carries no time zone of its own.
instant_of(value)
#
value as an instant when it is one — a datetime or a cg.Time — else None.
Source code in capturegraph-ui/capturegraph_ui/core/instants.py
label_html(value)
#
value as markup: an instant as a <time> the page shows locally, else its caption.
Source code in capturegraph-ui/capturegraph_ui/core/instants.py
label_json(value)
#
value as a component script's label: {"instant": iso} for an instant, else text.