Skip to content

v4.7.1

Latest

Choose a tag to compare

@knowledgecode knowledgecode released this 01 Nov 09:17
cdf243a

What's Changed

  • Fix arithmetic with UTC timezone objects by @mayankdhingra02 in #150
    • addDays() / addMonths() / addYears() now use UTC calendar setters when given a UTC timezone object, matching the 'UTC' string. Previously the object was treated as a non-UTC zone, which could shift results across DST in the host timezone and affect month-end clamping and leap years.
  • fix: Duration precision, LMT offsets, and 4.7.1 by @knowledgecode in #151
    • Duration: Sub-millisecond parts are now rounded to the nearest nanosecond, so values like 1.001 no longer lose a unit to floating-point error (new Duration(1.001).toMilliseconds().toParts() → { milliseconds: 1, microseconds: 1, nanoseconds: 0 }).
    • format(): The Z and ZZ tokens now print whole minutes for zones whose offset includes seconds (e.g. Local Mean Time). The offset is truncated toward zero, as Date#getTimezoneOffset() does.
    • Docs: Corrected the RFC 2822 format() and parse() examples (Z instead of ZZ), and documented how YYYY behaves above year 9999 and the date range format() and parse() support with the Buddhist calendar.

New Contributors

Full Changelog: v4.7.0...v4.7.1