-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Labels
c: datetimeComponent: dates, times, timezonesComponent: dates, times, timezonesenhancements: commentStatus: more info is needed to move forwardStatus: more info is needed to move forward
Description
An instance of DateTimeFormat
can do Date -> string
but cannot do the reverse string -> Date
for formatted strings it created.
It's very hard to implement that in user-land because different browsers might handle different languages in different ways?
My proposal is a parse
method that is reverse of the format
method:
const x = new Intl.DateTimeFormat(/* format options */);
// true, assuming format options are lossless
x.parse(x.format(aDate)).getTime() === aDate.getTime()
ray007, ulrichb, daiplusplus, msn0, ZyoxNet and 34 more
Metadata
Metadata
Assignees
Labels
c: datetimeComponent: dates, times, timezonesComponent: dates, times, timezonesenhancements: commentStatus: more info is needed to move forwardStatus: more info is needed to move forward