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

Feature Request: Relative Time #7

Open
saturnonearth opened this issue Feb 15, 2024 · 3 comments · May be fixed by #27
Open

Feature Request: Relative Time #7

saturnonearth opened this issue Feb 15, 2024 · 3 comments · May be fixed by #27

Comments

@saturnonearth
Copy link

Would love to see a "format relative time" helper, like date-fns

See: https://github.com/date-fns/date-fns/blob/f4e22da16/src/formatRelative/index.ts#L54

@mirague
Copy link

mirague commented Feb 16, 2024

I was looking for a "1 hour ago" relative time formatter as well in the (great) documentation and surprised it wasn't there. Adding this would make this even more powerful and complete.

@justin-schroeder
Copy link
Member

I would love this too — although the native relative time format is already quite good:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat

Perhaps tempo could offer pure syntactic sugar around this call.

@maninak
Copy link

maninak commented Mar 27, 2024

The versatility and ergonomics of javascript-time-ago, especially their Custom config, are worth looking into for inspiration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants