-
Notifications
You must be signed in to change notification settings - Fork 184
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
abstract-over DST change in .diff() #94
Comments
hey, thanks for your help. it looks like the confusion is in the hmmm. Do you agree? (ps you don't need to use |
Hi, @spencermountain, thanks for merge my changes, I'm really happy to help here. Just want to be clear that current implementation is what your described, it works like this
Not exactly 'full 7 days' literally but 7 days worth of ms. I'm totally agree the idea of dst awareness diff, just haven't figure out what's the more proper way to interprete the results, eg: start = '2018-03-29T00:00:00.000+13:00'
any suggestions? |
oh hey, you're completely right. Thank you. I was wrong yesterday. the add function is not correct then. The diff calculation can just use the same methods, so will not require any additional dst awareness step. Sorry about this. I can take a look at this, this week - or I will happily merge a PR with however you decide to fix it. |
hi, @spencermountain the PR has been filed, now add function does exactly what we discussed for 'year/season/quarter/month/week/days', but not for 'hour/minutes/sec' since that's some exact number user ask to add. Please let me know your thoughts, Thanks! |
Sympton
Weeks should be 1043 instead of
1047Cause
Week diff use climb way to adds weeks one by one until it reaches the target, the underlying adds function collects ms,sec,hour before the addition and then feeds them to the 'walk(s, want)' function to walk around and get precise match, but it could potentially step back for 23 hours rather than 1 hour while cross from non-dst to dst dates as shown in above, which cause the outer diff loop went more round and produce more week difference.Root cause
ok, just found the root of this:
it should be '04/04/2018 23:00' because dst instead of '0:00', the 'add' function actually step back for 23 hour.
Fix
- or just normal ms division instead of climb for 'week' diffplease @spencermountain, would like to hear your advise
definite need to fix the add & walk issue, should be come up a fix shortly
The text was updated successfully, but these errors were encountered: