-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Differences to moment? #58
Comments
+1 |
This is probably going to be the question front of mind for most people considering DayJS: Why DayJS instead of MomentJS? Personally, my team is moving away from moment and I'd like to know what tradeoffs I'd be making by choosing DayJS and if it meets my needs or not (eg: timezones or i18n concerns). Either way, best of luck. This looks like an incredible project! 👍 |
Will do |
Is dayjs fully compatible with moment? I hope to use alias in webpack to replace moment with dayjs, but I cannot ensure if it is ok to do it. Is there any guidelines? |
There are some functions that are not yet implemented, and others are available through plugins. Try to change the alias, and see if everything works fine |
Well, I found the second argument of |
@acrazing Dayjs accepts both I think |
@xxyuk um.. I use typescript to check it, its singular only and is required in |
Oh I see. We might could update it like this ? I'm not sure
But I'm not good with TS, anyone could send a PR to fix this? |
One thing I've just come across that's different is Moment accepts an array on constructor - e.g. |
@zediah Yes, Day.js can't parse array or object at this time. |
https://github.com/you-dont-need/You-Dont-Need-Momentjs Here is a simple comparison between Day.js, Moment.js, Luxon, Native Date and Date-fns. |
Would also be good if the readme mentioned Luxon, which is an immutable moment-js descendent. |
It looks like all of these Get + Set functions are missing from dayjs, even with all plugins enabled https://momentjs.com/docs/#/get-set/ |
@niftylettuce may be you are wrong. |
@xxyuk correct, I am wrong in the sense that the plural versions are not available, https://github.com/iamkun/dayjs/blob/dev/docs/en/API-reference.md#get-and-set, e.g. |
Please see #58 (comment) |
Could you add a section to the README.md that explains the differences to moment? Why is it faster/smaller? What features are missing? Are the parts of the API that are different? What was your motivation to "reinvent" the wheel?
The text was updated successfully, but these errors were encountered: