format
Formats provided date to a fuzzy time like 'a moment ago'.
If locale is passed will look for message for that locale, if you want to add or override locales use setLocaleMessages. Defaults to 'en'.
If clock is passed this will be the point of reference for calculating the elapsed time. Defaults to nowInMilliseconds
If minCutOff is passed from that date bellow all prefix and suffix disabled to show date without ago. Default value is None.
If isWeekFormatEnabled is true, week format enabled and show 7 days - 28 days as 1 week to 4 week.
If allowFromNow is true, format will use the Form prefix, i.e. a date 5 minutes from now in 'en' locale will display as "5 minutes from now".
Note: This function uses ISO 639-1 language code to identify the language. For more information see ISO 639-1.
Example:
TimeAgo.format(nowInMilliseconds()) // "a moment ago"
Since
1.1.0
Formats provided date to a fuzzy time like 'a moment ago'.
If locale is passed will look for message for that locale, if you want to add or override locales use setLocaleMessages. Defaults to 'en'.
If clock is passed this will be the point of reference for calculating the elapsed time. Defaults to nowInDate
If minCutOff is passed from that date bellow all prefix and suffix disabled to show date without ago. Default value is None.
If isWeekFormatEnabled is true, week format enabled and show 7 days - 28 days as 1 week to 4 week.
If allowFromNow is true, format will use the Form prefix, i.e. a date 5 minutes from now in 'en' locale will display as "5 minutes from now".
Note: This function uses ISO 639-1 language code to identify the language. For more information see ISO 639-1.
Example:
TimeAgo.format(nowInDate()) // "a moment ago"
Since
1.1.0
Formats provided date to a fuzzy time like 'a moment ago'.
If locale is passed will look for message for that locale, if you want to add or override locales use setLocaleMessages. Defaults to 'en'.
If clock is passed this will be the point of reference for calculating the elapsed time. Defaults to nowInCalendar
If minCutOff is passed from that date bellow all prefix and suffix disabled to show date without ago. Default value is None.
If isWeekFormatEnabled is true, week format enabled and show 7 days - 28 days as 1 week to 4 week.
If allowFromNow is true, format will use the Form prefix, i.e. a date 5 minutes from now in 'en' locale will display as "5 minutes from now".
Note: This function uses ISO 639-1 language code to identify the language. For more information see ISO 639-1.
Example:
TimeAgo.format(nowInCalendar()) // "a moment ago"
Since
1.1.0
Formats provided date to a fuzzy time like 'a moment ago'.
If locale is passed will look for message for that locale, if you want to add or override locales use setLocaleMessages. Defaults to 'en'.
If clock is passed this will be the point of reference for calculating the elapsed time. Defaults to now
If minCutOff is passed from that date bellow all prefix and suffix disabled to show date without ago. Default value is None.
If isWeekFormatEnabled is true, week format enabled and show 7 days - 28 days as 1 week to 4 week.
If allowFromNow is true, format will use the Form prefix, i.e. a date 5 minutes from now in 'en' locale will display as "5 minutes from now".
Note: This function uses ISO 639-1 language code to identify the language. For more information see ISO 639-1.
Example:
TimeAgo.format(now()) // "a moment ago"
Since
1.1.0
Formats provided date to a fuzzy time like 'a moment ago'.
If locale is passed will look for message for that locale, if you want to add or override locales use setLocaleMessages. Defaults to 'en'.
If clock is passed this will be the point of reference for calculating the elapsed time. Defaults to nowInLocalDateTime
If minCutOff is passed from that date bellow all prefix and suffix disabled to show date without ago. Default value is None.
If isWeekFormatEnabled is true, week format enabled and show 7 days - 28 days as 1 week to 4 week.
If allowFromNow is true, format will use the Form prefix, i.e. a date 5 minutes from now in 'en' locale will display as "5 minutes from now".
Note: This function uses ISO 639-1 language code to identify the language. For more information see ISO 639-1.
Example:
TimeAgo.format(nowInLocalDateTime()) // "a moment ago"
Since
1.1.0