Open kimlisa opened 6 months ago
The only small problem with Intl.DateTimeFormat
is that it takes locale as the argument and might include non-English words as part of the output. That is fine for short dates, but if we try to use it for spelling out "March 14th, 2024", then it's going to say "March" in whatever language the user has set.
Looking at the existing date helpers, it's probably better to just use them consistently throughout the code.
I just don't understand why the file is named loc.ts
, I'd have never guessed that it contains date helpers. Is it short for localization? Maybe it was created with that in mind, but we've never got to localizing Teleport I suppose.
@rudream It looks like the date helpers in loc.ts also have some built-in utilities to make sure that the output of them in tests is consistent no matter the environment. I remember you had a problem with some dates being formatted as 2019-08-30
vs 8/30/2019
depending on whether the tests were ran in VSCode vs iTerm (slack thread).
@rudream It looks like the date helpers in loc.ts also have some built-in utilities to make sure that the output of them in tests is consistent no matter the environment. I remember you had a problem with some dates being formatted as
2019-08-30
vs8/30/2019
depending on whether the tests were ran in VSCode vs iTerm (slack thread).
i just looked up the issue about date and this is issue, we are using toLocaleDateString
there
recording notes from meeting here:
We have various ways to show dates in our web UI
audit:
devices:
access list:
other areas:
our date helpers along with configured formats
@ravicious had nice suggestion here about using
Intl.DateTimeFormat
so that users are used to the time format from there location