Closed HitomaruKonpaku closed 6 months ago
In my opinion this field should be inside locale field, WDYT?
In my opinion this field should be inside locale field, WDYT?
Hmm I'm not really sure about that.
Will follow your call, but imo it isn't really related to locale since it will now follow the provided format without locale info
It is a locale matter, like language (the lng property), no?
I think it is more of a standard (like ISO 8601) 🤔
Anyway, do you wish to move it into locale
? 😄
I'm consulting with you 😄
You convinced me, I will review it soon. Thank you for the PR
I've reviewed the PR. I don't like the fact that you are using dateFns.format
. can we make some map from strings to Intl
config?
Maybe expose the entire Intl
options
The thing with Intl.DateTimeFormat
is that you can not specify exact format (or maybe I don't know how, please help me on this)
Like with this options (Intl.DateTimeFormat(locale, options)
), based on locale
config of the app (en-US
)
05/18/2024, 04:47:24
locale
= ja
, it will be 2024/05/18 04:47:24
2024-05-18 04:47:24
{
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit',
second: '2-digit',
hour12: false,
}
Hi, maybe the undefined
option here will help you?
console.log(event.toLocaleDateString(undefined, options));
// expected output (varies according to local timezone and default locale): Thursday, December 20, 2012
Hi there @felixmosh
This is the result I got
Ok, I see that it doesn't solves your issue. I will approve it, and will refactor the it a bit, thank you 🙏
Released in v5.18.2
743
dateFormats
inUIConfig
short
: When timestamp is in same day (today)common
: When timestamp is in same yearfull
Seem like
Timeline
is the only place that have date/time format, I didn't check other page/component