Skip to content

v1.3.0

Choose a tag to compare

@arashm arashm released this 28 Jul 10:50
· 21 commits to master since this release
c237e2d

Bug fixes to the conversion and month arithmetic, and a rebuilt toolchain. Published to npm as jalali-date@1.3.0.

Bug fixes

  • fixedToGregorian passed an array where three arguments were expected, making the January/February branch unreachable and returning out-of-range days such as [2021, 2, 0] for Jan 31. Round-tripping every valid date from 1600–2400 now succeeds.
  • The setters assigned to input instead of _d, so getDay() and the day-name format identifiers kept reporting the weekday the instance was constructed with. input now stays as the original constructor argument and _d is what the setters keep in sync.
  • fixMonth carried month overflow into the year with an inverted sign, so setMonth(13) moved back a year instead of forward.
  • daysInMonth had the same inverted carry, plus a normalization that mapped month 0 onto اسفند and reported 30 days for فروردین. It remains zero-based; the README now documents how that differs from getMonth().

Breaking changes

  • AMD/RequireJS is no longer supported. esbuild has no UMD output, so the browser bundles are plain IIFEs.
  • IE11 is no longer supported. The bundles target ES2019.
  • main now points at lib/jdate.cjs rather than the development bundle, which had been shipping a 62 KB file with an inline source map as the package entry point.

Build

webpack and babel-loader are replaced by a single esbuild script. Four bundles are served behind an exports map — lib/jdate.mjs (ESM), lib/jdate.cjs (CommonJS), lib/jdate.js and lib/jdate.min.js (IIFE, sets window.JDate). The minified bundle drops from 36,293 to 5,047 bytes, mostly because Babel is no longer downleveling to ES5. files, engines and sideEffects are added so the published tarball contains only lib/ and metadata.

Development moved to ESLint 10 flat config, Jest 30 and npm (from Yarn).

Full changelog: 1.2.0...1.3.0