-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Feature/implement generic add #1504
Feature/implement generic add #1504
Conversation
As a substitue to `add(Object)` in Moment
use object assign instead
@leshakoss @alaskaa @dkozickis can you please review this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your PR @Anshuman71!
Please go through the comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function is good, but as of now in a bundle it would be huge: it includes, for example, the impossible condition if (arguments.length < 2) ...
8 times.
Please optimize the function by copying and pasting the logic inside all of addX
functions into this one, optimizing where possible (for example you can add ms, seconds, minutes and hours on the same line because all of these are milliseconds multiplied by some constant). After that, the function should be able to do everything addX
do, but without importing them.
Thankyou, I will surely optimize the code with the above advise |
@Anshuman71 hey, I love the PR, but I see that I've removed the repo, and now I can't resolve the conflicts and clean up the code. I'll appreciate it if you can push it again or send me the patch file. Thanks! |
Hey @kossnocorp, thanks for your feedback. I moved this to #1581 . Please look into and let me know if need any changes. |
Implement the
add(Object)
function from Moment and fix #1427Supports adding
combined in a single call