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
pdt1=Temporal.PlainDateTime.from('2023-02-28T03:00:00')pdt2=Temporal.PlainDateTime.from('2023-04-01T02:00:00')dur=pdt1.until(pdt2,{largestUnit: 'year'})// ACTUAL: { months: 1, hours: 23 }// EXPECTED: { months: 1, days: 3, hours: 23 }// why ACTUAL is wrong?pdt1.add({months: 1,hours: 23}).toString()// 2023-03-29T02:00:00 (does NOT match pdt2)// why EXPECTED is correct?pdt1.add({months: 1,days: 3,hours: 23}).toString()// 2023-04-01T02:00:00 (DOES match pdt2)
Happening because, when there's a time-sign mismatch, the origin date is incorrectly progressed 1 day forward instead of the destination date being regressed 1 day back before proceeding with the date-diff.
Recreation:
Happening because, when there's a time-sign mismatch, the origin date is incorrectly progressed 1 day forward instead of the destination date being regressed 1 day back before proceeding with the date-diff.
proposal-temporal/polyfill/lib/ecmascript.mjs
Lines 3862 to 3870 in e78869a
The text was updated successfully, but these errors were encountered: