Closed jonklein closed 8 years ago
77.03%
Merging #153 into master will increase coverage by +0.07% as of
2a987bc
@@ master #153 diff @@
======================================
Files 14 14
Stmts 1554 1563 +9
Branches 294 297 +3
Methods 0 0
======================================
+ Hit 1196 1204 +8
- Partial 94 95 +1
Missed 264 264
Review entire Coverage Diff as of
2a987bc
Powered by Codecov. Updated on successful CI builds.
Thanks for the fix and with tests!
This PR fixes two distinct issues parsing strings with time offsets relative to days of the week.
The first issue is that the modifier "offset" is being turned into a week offset for the day of week. This makes sense for parsing some modifiers ('next', 'last', 'prior', 'previous'), but not for others ('from', 'before', 'after').
The second issue is that even with the previous issue fixed, backwards offsets were not applied properly for day-of-week modifiers. The day of week was resolved properly, but parsing of the remaining chunk was left to the caller and would always offset forward.
The added test cases demonstrate the issues and the fix, as do the examples below.
Before:
After: