ctrl+k
Enter a search term above to see results...
Enter a search term above to see results...
Date helpers provide utilities for formatting dates and times in templates.
Formats a date according to the specified format string.
Name | Type | Default | Description |
---|---|---|---|
date | Date | new Date() | The date to format |
format | string | ’L’ | The format string |
options | object | { timezone: ‘local’ } | Additional options |
Name | Type | Default | Description |
---|---|---|---|
locale | string | ’default’ | The locale to use for formatting |
hour12 | boolean | true | Whether to use 12-hour time |
timezone | string | ’local’ | The timezone to use. Use ‘local’ for the local timezone |
string
- The formatted date string.
Formats a date with time according to the specified format string.
Name | Type | Default | Description |
---|---|---|---|
date | Date | new Date() | The date to format |
format | string | ’LLL’ | The format string |
options | object | { timezone: ‘local’ } | Additional options |
Name | Type | Default | Description |
---|---|---|---|
locale | string | ’default’ | The locale to use for formatting |
hour12 | boolean | true | Whether to use 12-hour time |
timezone | string | ’local’ | The timezone to use. Use ‘local’ for the local timezone |
string
- The formatted date and time string.
Formats a date with time and seconds according to the specified format string.
Name | Type | Default | Description |
---|---|---|---|
date | Date | new Date() | The date to format |
format | string | ’LTS’ | The format string |
options | object | { timezone: ‘local’ } | Additional options |
Name | Type | Default | Description |
---|---|---|---|
locale | string | ’default’ | The locale to use for formatting |
hour12 | boolean | true | Whether to use 12-hour time |
timezone | string | ’local’ | The timezone to use. Use ‘local’ for the local timezone |
string
- The formatted date, time, and seconds string.
Note: The ‘local’ timezone uses the timezone of the environment where the code is running. This is useful for displaying dates in the user’s local time without needing to detect the timezone programmatically.