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

Switching format after an amount of time #11

Open
omar2205 opened this issue Dec 25, 2021 · 1 comment
Open

Switching format after an amount of time #11

omar2205 opened this issue Dec 25, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@omar2205
Copy link

I want to use the relative time, 'a minute ago', but after a couple of hours, I want to switch it to say `04:40 am'.

@metonym metonym added the enhancement New feature or request label Dec 27, 2021
@metonym
Copy link
Owner

metonym commented Jan 20, 2022

This would also be useful for customizing a formatted date to also include the relative timestamp.

Jan. 2020 (2 years ago)

The API could look like:

<Time format="MM. YYYY" display={({ relative, formatted }) => `${formatted} (${relative})`} />

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

No branches or pull requests

2 participants