You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.
Default DateTime.Compare ignores the Kind property. We should:
Add a new guard, KindSpecified, to require a DateTime argument to have kind that is either Local or Utc, so people can force callers to think about the source of their time values and specify the kinds explicitly.
Add non-generic overloads to Equal, NotEqual, Min, Max and InRange that accept DateTime arguments and throw if (a.Kind == Unspecified) != (b.Kind == Unspecified) (DateTime already accounts for the time difference when comparing Local values to Utc values).
The second bullet is a breaking change, so I'm adding this to the 2.0 milestone.
The text was updated successfully, but these errors were encountered:
Split from #40
Default
DateTime.Compare
ignores theKind
property. We should:KindSpecified
, to require aDateTime
argument to have kind that is eitherLocal
orUtc
, so people can force callers to think about the source of their time values and specify the kinds explicitly.Equal
,NotEqual
,Min
,Max
andInRange
that acceptDateTime
arguments and throw if(a.Kind == Unspecified) != (b.Kind == Unspecified)
(DateTime
already accounts for the time difference when comparingLocal
values toUtc
values).The second bullet is a breaking change, so I'm adding this to the 2.0 milestone.
The text was updated successfully, but these errors were encountered: