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

RelativeDateTime component #50

Closed
queicherius opened this issue Aug 1, 2017 · 2 comments
Closed

RelativeDateTime component #50

queicherius opened this issue Aug 1, 2017 · 2 comments

Comments

@queicherius
Copy link
Contributor

queicherius commented Aug 1, 2017

First off, thanks for this project. It's pretty much exactly what I wished for while being significantly smaller than other implementations.

const date = new Date(new Date() - 30 * 1000)
magic(date) -> '30 seconds ago'

Is there any way (now or planned) to format a date as a relative time string? Or is there another preferred way of dealing with these - I am thinking about a custom component and translation messages?

Or to word it differently, if you think that its best dealt with with a custom component, would you be interested to have something like that in the docs?

@tricoder42
Copy link
Contributor

Hello,
yes I'm thinking about it. For now it might be enough to create custom component in your project.

I need to solve a related problem before implementing it in jsLingui or other package: How to release localized 3rd party components. Sth like namespacing for localized messages (#14).

react-intl suffers few problems with FormatRelative - you can't change wording of messages and you have to load messages provided by library even when you're not using FormatRelative component. It's few bytes for one component, but I imagime we would like to add more components with predefined translations, so you could just import them in your project without need to translating them on your own.

It would be definitely great to mention it in docs. Probably section like Releasing localized components or something similar.

@tricoder42 tricoder42 changed the title Relative date time RelativeDateTime component Sep 29, 2017
@tricoder42 tricoder42 added this to the 3.0 Macros milestone Aug 10, 2018
@stale
Copy link

stale bot commented Oct 29, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Oct 29, 2020
@stale stale bot closed this as completed Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants