Tried to use date-fns and encounter problems with utc date. Example:
startOfMonth(new Date('2011-05-31'), 1).toISOString() //"2011-05-01T00:00:00.000Z" OK
startOfMonth(new Date('2011-05-21'), 1).toISOString() //"2011-05-01T00:00:00.000Z" OK
startOfMonth(new Date('2011-05-01'), 1).toISOString() //"2011-04-01T00:00:00.000Z" NOK
This inconsistency, made follow @wagnerssouza suggestion to use moment. It's a bigger lib, but importing only the methods that will be used I belived isn't a burden on the app.
Tried to use date-fns and encounter problems with utc date. Example:
This inconsistency, made follow @wagnerssouza suggestion to use moment. It's a bigger lib, but importing only the methods that will be used I belived isn't a burden on the app.
resolves #1