-
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
Disallow initializing CalDateTime
from DateTimeKind.Local
and some cleanup
#704
Conversation
Codecov ReportAttention: Patch coverage is @@ Coverage Diff @@
## main #704 +/- ##
===================================
Coverage 65% 65%
===================================
Files 103 103
Lines 4660 4658 -2
Branches 1119 1128 +9
===================================
+ Hits 3025 3027 +2
+ Misses 1203 1198 -5
- Partials 432 433 +1
|
} | ||
|
||
public abstract IEnumerable<Period> Evaluate(IDateTime referenceDate, DateTime? periodStart, DateTime? periodEnd, bool includeReferenceDateInResults); | ||
public abstract IEnumerable<Period> Evaluate(IDateTime referenceDate, IDateTime? periodStart, IDateTime? periodEnd, bool includeReferenceDateInResults); |
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.
nullable arguments should have #nullable enable
. The effort shouldn't be too big? Otherwise I could just do that in another 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.
Oh yes. It actually wasn't my intention to introduce nullable, but now that it's already there, I tried to enable #nullable
for the affected files :-D I'm not using it too much, so please have a close look!
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.
See some minor remarks. Very good!
…DateTime` to avoid ambiguity.
b781cd3
to
3db7dea
Compare
|
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 - thanks again!
Significant efforts were made lately to reduce the ambiguity that comes from dealing with
System.DateTime
withDateTimeKind.Local
. The latter refers to the system's local time zone, which is not something that ical.net is aware of and wants to deal with. This PR cleans up some of the remaining places whereDateTimeKind.Local
could still appear and dissallows initializingCalDateTime
instances with aDateTime
of kindLocal
.It also changes the parameters of
IEvaluator.Evaluate()
fromSystem.DateTime
toIDateTime
to avoid ambiguity and does some other minor cleanup.Fixes #406