Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions to format the distance between a given date and now #87

Open
2 tasks
Seddryck opened this issue Dec 12, 2022 · 0 comments
Open
2 tasks

Functions to format the distance between a given date and now #87

Seddryck opened this issue Dec 12, 2022 · 0 comments
Labels
extension This feature should be supported by an extension (other package)

Comments

@Seddryck
Copy link
Owner

  • The function format-elapsed-time is returning the textual representation of the distance between the given date and now. If the given date is in the future, returns null.
Distance between dates Result
0 ... 30 secs less than a minute
30 secs ... 1 min 30 secs 1 minute
1 min 30 secs ... 44 mins 30 secs [2..44] minutes
44 mins ... 30 secs ... 89 mins 30 secs about 1 hour
89 mins 30 secs ... 23 hrs 59 mins 30 secs about [2..24] hours
23 hrs 59 mins 30 secs ... 41 hrs 59 mins 30 secs 1 day
41 hrs 59 mins 30 secs ... 29 days 23 hrs 59 mins 30 secs [2..30] days
29 days 23 hrs 59 mins 30 secs ... 44 days 23 hrs 59 mins 30 secs about 1 month
44 days 23 hrs 59 mins 30 secs ... 59 days 23 hrs 59 mins 30 secs about 2 months
59 days 23 hrs 59 mins 30 secs ... 1 yr [2..12] months
1 yr ... 1 yr 3 months about 1 year
1 yr 3 months ... 1 yr 9 month s over 1 year
1 yr 9 months ... 2 yrs almost 2 years
N yrs ... N yrs 3 months about N years
N yrs 3 months ... N yrs 9 months over N years
N yrs 9 months ... N+1 yrs almost N+1 years
  • The function format-elapsed-seconds is returning the textual representation of the distance between the given date and now. If the given date is in the future, returns null.
Distance between dates Result
0 secs ... 5 secs less than 5 seconds
5 secs ... 10 secs less than 10 seconds
10 secs ... 20 secs less than 20 seconds
20 secs ... 40 secs half a minute
40 secs ... 60 secs less than a minute
60 secs ... 90 secs 1 minute
90 secs ... more than a minute
@Seddryck Seddryck added the enhancement Enhancement to an existing feature label Dec 12, 2022
@Seddryck Seddryck added extension This feature should be supported by an extension (other package) and removed enhancement Enhancement to an existing feature labels Mar 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension This feature should be supported by an extension (other package)
Projects
None yet
Development

No branches or pull requests

1 participant