3 ms·
Full disclosure I haven't used Luxon nearly as much as I've used DayJS, but I would say IMO DayJS is way simpler and more intuitive, this is a very small thing
by _fat_santa 4y ago
Full disclosure I haven't used Luxon nearly as much as I've used DayJS, but I would say IMO DayJS is way simpler and more intuitive, this is a very small thing but for example, why would they format Months, by "L" instead of by "M"?
The other reason I like DayJS over Luxon is the sheer number of plugins you can pull in to do various things. Like for example I was building an application where I had to build a weekly calendar form for a timesheet, the requirement was weeks start on Saturday and end of Friday.
In DayJS I was able to do this pretty easily by doing: dayjs().startOf('week').subtract(1, 'day') to get the start and then took the result and did res.add(6, 'days') to get the end. I'm not sure if Luxon has this type of functionality.
Lastly I like the plugin architecture rather than giving you everything up front. By default DayJS does not include any of those cool transformations like I talked about above, you have to pull them in as plugins from DayJS, this results in a bit more setup but smaller bundle sizes at the end of the day.
- icambron 4y agoIn Luxon that is dt.startOf(“week”).plus({ days : 6 })
- Mogzol 4y ago> why would they format Months, by "L" instead of by "M" "M" is used for months in Luxon, and is usually what you should use. "L" is only for standalone months, i.e. not within a date string, usually not what you want. In English these are the same thing, but in some languages they are different. https://github.com/moment/luxon/blob/master/docs/formatting.md#standalone-vs-format-tokens https://github.com/moment/luxon/blob/master/docs/formatting....