-
Notifications
You must be signed in to change notification settings - Fork 67
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
Problem with Business Day calculation #109
Comments
Apparently this is a bug in 1.2.0 version, Please publish version 1.3.0 to npm. Thx! |
Yes, @eduolalo should release a new version on npm, since he's the only one with access rights. In the meantime, you can use github links like this:
|
Here is the one I published https://www.npmjs.com/package/@mobile-next/moment-business-days if anyone needed |
This still seems to happen for me in my testing on the newer version. Just seems to happen less often though. Example code:
Seems to somehow be dependent on the ms of the current time oddly enough because if I change |
I'm not sure actually on how moment.diff works, if let's say 23:59 yesterday is diffed against 00:00 today, when rounded to days, returns 1 or 0. If you need, you can either use startOf day for both like you mentioned or set a fixed time like noon to both moment objects to work around the issue. |
@mcdado Ah, that makes perfect sense. Thank you. |
I guess if @eduolalo won't show up I'll publish it under a different npm name. |
In my opinion in all cases it should log 4, as Saturday and Sunday are not working days.
Do I miss something here?
The text was updated successfully, but these errors were encountered: