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

Translate message date #214

Open
luisfuertes opened this issue Jan 18, 2024 · 0 comments
Open

Translate message date #214

luisfuertes opened this issue Jan 18, 2024 · 0 comments

Comments

@luisfuertes
Copy link

I have been looking for how to translate the date of messages such as "Just now" but I have only seen the prop: "dateString"

This works if the message is always at a fixed time, but if for example I want to put the "Just now" in other languages, I can use the same library that I have seen you use, "Timeago.js" and create a locale to translate it into Spanish for example. But since it appears as a string in the list, the value is not updated and even if 3 hours have passed since the message was written, the text will continue to be "Just now" or the one assigned to it in the message in the list as "dateString"

I think that for this to work correctly instead of "dateString" the prop should be "dateFormat" and be able to pass it the function that formats the desired date.

Is this correct or am I making a mistake about how to change the language in which the dates are displayed?

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

No branches or pull requests

1 participant