Skip to content

Changelog

The full release history is in the changelog:

4.0 is a near-total rewrite for modern Dart (3.13+). Almost every class has breaking changes. Read Upgrading to 4.0 before you upgrade.

  • Dart 3.13 or later is required. Classes are now final, so you can’t extend or implement them.
  • NepaliDateTime is instant-based, like DateTime. It can be local, UTC or Nepal Time.
    • NepaliDateTime.now() now returns local time. Use nepalNow() for Nepal time.
    • DateTime.toNepaliDateTime() keeps the time zone. Add .toNepalTime() to get the old behaviour.
    • Out-of-range components are normalised, == compares values, and parse follows DateTime.parse.
  • NepaliDateFormat follows intl’s DateFormat: intl’s skeleton layouts and pattern letters, and it’s immutable.
  • NepaliNumberFormat follows intl’s NumberFormat. Named constructors and copyWith replace the old constructor flags. Numbers are rounded instead of truncated.
  • NepaliUtils is static: NepaliUtils.defaultLanguage = … and withLanguage.
  • NepaliMoment is an immutable formatter. Its English phrases and thresholds now match moment.js.
  • NepaliUnicode is a const instance with styles: const NepaliUnicode().convert(…). live: true became convertLive. {…} now escapes text.
  • Measurement units: NepaliArea, NepaliWeight and NepaliVolume.
  • Phone numbers: NepaliPhoneNumber, with the operator, the district, formatting and findAll.
  • Preeti & Devanagari: Preeti.toUnicode / fromUnicode and the Devanagari helpers.
  • Unicode styles: google, mppRomanized and mppTraditional, plus toRoman and stream support.
  • Moment: formatDuration, formatUnit, calendar, a short style, and weeks.
  • Number formatting: percent, currency, compact (12.3L), real number words, custom patterns and parsing.
  • Date formatting: the L, c, D, K, k, z/v and Z letters, skeleton constants and addPattern.
  • Language converts to and from locales.
  • AD → BS conversion is about 16× faster, and weekday is about 500× faster.
  • NepaliUnicode converts in a single pass. 10,000 characters take about 0.4 ms instead of 13.6 s.