Relative time
Relative time displays time in a way that is clear, concise, and accessible.
On this page
Description
Formats a timestamp as a localized string or as relative text that auto-updates in the user's browser.
Arguments
Name | Type | Default | Description |
---|---|---|---|
datetime | Time | N/A | The time to be formatted. |
tense | Symbol |
| Which tense to use. One of |
prefix | String |
| What to prefix the relative time display with. |
second | Symbol |
| What format seconds should take. One of |
minute | Symbol |
| What format minues should take. One of |
hour | Symbol |
| What format hours should take. One of |
weekday | Symbol |
| What format weekdays should take. One of |
day | Symbol |
| What format days should take. One of |
month | Symbol |
| What format months should take. One of |
year | Symbol |
| What format years should take. One of |
time_zone_name | Symbol |
| What format the time zone should take. One of |
threshold | String |
| The threshold, in ISO-8601 'durations' format, at which relative time displays become absolute. |
precision | Symbol |
| The precision elapsed time should display. One of |
format | Symbol |
| The format the display should take. One of |
format_style | Symbol |
| The format the display should take. One of |
lang | String |
| The language to use. |
title | String |
| Provide a custom title to the element. |
no_title | Boolean |
| Removes the |
system_arguments | Hash | N/A |