This repository has been archived by the owner on May 3, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Dates
Lukas Jans edited this page Feb 21, 2019
·
1 revision
To render a Date
object, assign it to a regular section and add formatting placeholders as content. These parameters will be automatically rendered according to the table at the bottom. The example below will output the current date in the international format:
Elements.render(`
{{#date}}
{{Y}}-{{m}}-{{d}}
{{/date}}
`, {
date: new Date(),
});
The following parameters can be used:
Char | Description | Values |
---|---|---|
d | Day of the month, 2 digits with leading zeros | 01 to 31 |
j | Day of the month without leading zeros | 1 to 31 |
w | Numeric representation of the day of the week | 0 (Sunday) to 6 (Saturday) |
m | Numeric representation of a month, with leading zeros | 01 to 12 |
n | Numeric representation of a month, without leading zeros | 1 to 12 |
Y | A full numeric representation of a year, 4 digits | Examples: 1999 or 2014 |
G | 24-hour format of an hour without leading zeros | 0 to 23 |
H | 24-hour format of an hour with leading zeros | 00 to 23 |
i | Minutes with leading zeros | 00 to 59 |
s | Seconds, with leading zeros | 00 to 59 |
(Date parameters from php)