-
Notifications
You must be signed in to change notification settings - Fork 233
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
CalDateTime Arithmetic Operations #672
Conversation
- Ensure `TimeSpan` add and subtract methods are reversible across DST transitions. - Consolidate all time-related arithmetic operations into a single method for consistency and maintainability. - Add related unit tests
Removed `+` and `-` operator overloads for `CalDateTime` that handled adding and subtracting `TimeSpan` objects
Throw when attempting to add/subtracting a time span to/from a date-only instance, and the time span is not a multiple of full days.
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #672 +/- ##
===================================
- Coverage 63% 63% -0%
===================================
Files 99 99
Lines 4576 4550 -26
Branches 1079 1075 -4
===================================
- Hits 2886 2863 -23
Misses 1240 1240
+ Partials 450 447 -3
|
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.
LGTM. Added some comments that might a subject rather for a follow-up PR rather than for this one.
The |
This should already work. |
|
Fix CalDateTime Arithmetic Operations
TimeSpan
add and subtract methods are reversible across DST transitions.Remove TimeSpan operator overloads from CalDateTime
Removed
+
and-
operator overloads forCalDateTime
that handled adding and subtractingTimeSpan
objectsThrow for invalid time span operations on date-only instance
Throw when attempting to add/subtracting a time span to/from a date-only instance,
and the time span is not a multiple of full days.
Resolves #670