-
Notifications
You must be signed in to change notification settings - Fork 756
Closed as not planned
Closed as not planned
Copy link
Labels
Description
I'm thinking the following:
wall-time(load): Get load-time wall clock time at millisecond resolution. Useful for starting infinite, time-dependent animations like clocks at the right phase.wall-time(current): Get current wall clock time at millisecond resolution. Updates every frame. Useful for some advanced uses, as well as stuff likecontent: datetime(var(--post-time), if(calc(wall-time(current) - 86400s < var(--post-time)), relative, absolute)(see below). The lack of timers makes it way simpler to code.datetime(offset? <datetime-option>+): Display a localized date-time string. Takes a number of options, mostly inspired byIntl.DateTimeFormat(but with a different syntax). If omitted,offsetis the current time, continuously updated. Possible options:relative,absolute: Display as relative or absolute. Default is absolute. If relative, it'll update in real time, so you don't have to keep it in sync.locale(<locale-ident> | default): Display using the given locale. Optionally can follow the identifier withlookupor (default)best-fitto set the matching algorithm. This is also used for specifying numbering system, calendar, and optionally hour cycle.format(lookup | best-fit): Sets the format matcher algorithm. Default isbest-fit.timezone(<string>? + [long | short]? + [localized | offset | generic]?): Set the time zone to display as. Default is the runtime's default time zone (usually the local one). The other options control the equivalent of thetimeZoneNameparameter forDateTimeFormat.weekday(long | short | narrow): Set the weekday representation.era(long | short | narrow): Set the era (CE/BCE/etc.) representation.year(numeric | two-digit): Set the year representation.month(numeric | two-digit | long | short | narrow): Set the month representation.day(numeric | two-digit): Set the day representation.hour([numeric | two-digit] + [12 | 24] + [long | short | narrow]): Set the hour representation.12forces 12-hour, while24forces 24-hour.minute(numeric | two-digit): Set the minute representation.second(numeric | two-digit): Set the second representation.fractional-digits(0 | 1 | 2 | 3): Set the number of fractional second digits. Default is zero.date-style(full | long | medium | short): Set the date style, like indateStyleforIntl.DateTimeFormattime-style(full | long | medium | short): Set the time style, like intimeStyleforIntl.DateTimeFormat
I've noticed date displaying shows up pretty much constantly, and it'd be nice to be able to simply do content: datetime(attr(data-time ms)); in CSS with data-time="{{ms}}" rather than having to roll a <span>{{date_time}}</span> possibly across hundreds of instances.
TheOneTheOnlyJJ, bradkemper and bleper