When comparing date-fns vs Luxon, the Slant community recommends date-fns for most people. In the question“What are the best JavaScript date formatting libraries?” date-fns is ranked 1st while Luxon is ranked 5th. The most important reason people chose date-fns is:
Developers can pick only the functions they need to reduce the size of the library that's being downloaded (using bundlers such as webpack or browserify)
Ranked in these QuestionsQuestion Ranking
Pros
Pro Modular
Developers can pick only the functions they need to reduce the size of the library that's being downloaded (using bundlers such as webpack or browserify)
Pro Immutable
Uses pure functions and always returns a new date object to prevent unexpected results.
Pro Time zone support
Claims to be the best date formatting library at handling time zones
Pro Explicit API
Function names describe exactly what they do so it's easier to work with.
Pro Immutable
All types in Luxon are immutable making it more predictable.
Cons
Con Their "distance in words" function is not very customizable
When comparing a certain date to the current date the function returns a pretty "opinionated" sentence such as "almost 2 years" which can't really be customizable and requires string manipulation to fit result to your needs.
Con Lacks relative date formatting functions
Luxon currently doesn't have any relative date formatting functions (e.g. from(time), to(time), fromNow(), toNow(), etc..). Its creators are waiting for modern browsers to implement the Relative Time Format which can take a while.
Alternative Products
