4 comments

[ 3.5 ms ] story [ 15.4 ms ] thread
(comment deleted)
In regards to date management, has anyone ever replaced moment with date-fns: https://date-fns.org/ ? It seems to be the lodash for dates, in which you can do selective imports.
yes, using it in production for this exact reason. seems to have all the features moment has + it does not mutate date objects in place. thumbs up!
As a further alternative, I keep wondering what's left to further standardize towards Intl.DateTimeFormat [1][2] to leave it to the browsers to know the local locale?

I suppose for me and my projects perhaps the biggest usages of Moment are actually for the "humanizing" formats time until/time since (the things like "20 minutes ago"/"3 days from now"). The locale data for those likely may never be standardized into Intl. (~I also don't see equivalents of those functions in a quick skim of date-fns docs, fwiw.~ ETA: Of course I spot it soon after posting the comment; formatDistance)

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

[2] http://caniuse.com/#search=intl