DEV Community

Discussion on: Formatting Dates With the DateTimeFormat Object

Collapse
 
georgewl profile image
George WL

This is honestly brilliant. I may start removing dayjs/moment from apps and switching to this.

Collapse
 
aumayeung profile image
John Au-Yeung

Yea. We don't need libraries to format JavaScript dates.

JavaScript also has built-in support for plurals and formatting lists.

Collapse
 
oshliaer profile image
Alexander Ivanov

It seems using fr-ca format for convert to YYYY-MM-DD is a hack and it's not "We don't need yada-yada-yada".

@john , Is there a direct approach?

Thread Thread
 
bravemaster619 profile image
bravemaster619

Nope. You can use formatToParts but it's not currently supported by IE.