⚙️ timestamp
Add static timestamp
Simple static customizable timestamp, which shows the date and|or time of last save. This is static timestamp, it will update or added on save. The result will be wrapped in p
tag.
→ See this page in edit mode.
Example
Code
Note the YAML syntax for nested options ("options" key)
```h:timestamp
locale: "en-US"
template: "<small>Last saved: $time</small>"
options:
timeStyle: short
dateStyle: long
hourCycle: h24
```
Result
Last saved: January 23, 2025 at 20:20
Using with autoload
This helper is adapted for autoload. You may pass the same options for autoloaded helper, plus exclude
option, which works the same way, as the one in navbar helper. Autoloaded helper will add timestamp at the bottom of each page (except excluded) on save.
Code
{
...
["timestamp" ,
{locale: "en-AU" ,
options:{
dateStyle: "long"
}
}],
...
}
Parameters
name | meaning | type | default |
---|---|---|---|
locale | Locale code for Intl.DateTimeFormat | String | Nothing |
template | Template for timestamp. $time will be replaced with formatted time |
String | "<small style='color:silver'>—$time</small>" |
options | Options for Intl.DateTimeFormat | Dictionary | Empty |
Last saved: 1/23/25, 20:20