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
I'm not super sure whether this is best added to this project's issues or the main date-fns one!
When using the in context property with some functions, such as endOfDay, the following TS error is shown:
endOfDay(date, { in: options.in ?? tz('UTC')})
Leads to:
Type 'TZDate' is not assignable to type 'ResultDate'.
'TZDate' is assignable to the constraint of type 'ResultDate', but 'ResultDate' could be instantiated with a different subtype of constraint 'Date'.
The function itself does work as expected, as seen in this sandbox, and the output is consistent with using UTCDate or similar to define the date. So this looks like a typing issue, rather than a functional one?
The docs seem to indicate that this should be fine, so I don't believe I'm doing anything crazy here :D
The text was updated successfully, but these errors were encountered:
I'm not super sure whether this is best added to this project's issues or the main
date-fns
one!When using the
in
context property with some functions, such asendOfDay
, the following TS error is shown:Leads to:
The function itself does work as expected, as seen in this sandbox, and the output is consistent with using
UTCDate
or similar to define the date. So this looks like a typing issue, rather than a functional one?The docs seem to indicate that this should be fine, so I don't believe I'm doing anything crazy here :D
The text was updated successfully, but these errors were encountered: