-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Change message timestamp format #2162
Comments
I will try to fix that issue ✋ |
hey, thanks for the interest, I've assigned the issue to you |
I think this should be formated locale-based. You could use Date.toLocaleDateString(). @workshur any suggestions? |
I think we could use localestring for now and then switch to configurable version |
@hyzyla as far as I remember, the timestamp is being formatted on frontend. Can you format it with taking user browser's preferences into consideration? |
Yes, sure |
So, after some investigation, I found that formatting to user locale is challenging, because Let me know if you think that snippet is OK to use for detecting locale |
@provectus/kafka-frontend need opinions |
I would suggest getting rid of try {
date = new Date('2022-06-06T12:44:42.118Z');
date.toLocaleString();
} catch .... |
Problem with toLocaleString is that function isn't not consistent within different browsers [1]. For example, I have "uk" locale, but Firefox decide to format in en-US, while Chrome format in some weird format 18/06/2022 |
From my point of view, there is no right solution. Let's wait until BE for the custom locale is ready. Let the user decide which format is more convenient for him |
@hyzyla actually are you sure your browser locales are 'uk'? It seems like both are us |
US locale: mm/dd/yyyy
any other locale: dd-mm-yyyy
The text was updated successfully, but these errors were encountered: