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
addISOWeekYears resets times to midnight local time. I didn't find this behavior in any other date-fns APIs.
Repro:
// time zone: America/Los_Angelesconstbase=newDate(2020,4,8,3);console.log(base)// Fri May 08 2020 03:00:00 GMT-0700 (Pacific Daylight Time)constaddOneIsoYear=addISOWeekYears(base,1)console.log(addOneIsoYear)// Fri May 14 2021 00:00:00 GMT-0700 (Pacific Daylight Time)// note that the time is lost.
The text was updated successfully, but these errors were encountered:
That's definitely unexpected behavior. The problem is in setISOWeekYear that sets the time to midnight.
It's not consistent with the rest of the library and worth fixing. My only fear is that some folk rely on this behavior, and this would be a breaking change.
addISOWeekYears
resets times to midnight local time. I didn't find this behavior in any other date-fns APIs.Repro:
The text was updated successfully, but these errors were encountered: