DEV Community

Discussion on: Handling Dates in JavaScript

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt
  1. What is the correct way to write 2020-01-01 1:00, so that Date constructor / moment doesn't complain (without directly specifying Date format)?
  2. moment.js is large and mutable. One mighy consider alternatives, such as Luxon, date-fns or dayjs.
Collapse
 
aumayeung profile image
John Au-Yeung
  1. This is the closest thing I can find to format dates in the format you ask for gist.github.com/noromanba/6737784

  2. I think date-fns is also good.