Skip to content

Nepali Date NodeJS - Changelog

List of Changes of all versions of Nepali Date NodeJS from v1.1.14

[1.1.16] - 2026-08-10

Fixed

  • BS Date Off-By-One Near Midnight in Nepal
    • The current Nepali date (new NepaliDate(), or any real Date passed into the constructor) was derived straight from the input's UTC calendar date
    • Since Nepal Standard Time is UTC+05:45, the calendar day rolled over 5 hours 45 minutes late — the BS date showed one day behind actual Nepal time between local midnight and 5:45 AM
    • Added an explicit NEPAL_UTC_OFFSET_MS constant; the Nepal wall-clock date is now computed before deriving the BS year/month/day, so results are correct at any moment regardless of the server's own timezone
  • getHours() / getMinutes() / getSeconds() / getDay() Now Nepal Local Time
    • Previously read the host's local time (getHours/getMinutes/getSeconds) or the raw UTC instant (getDay, fixed to UTC in 1.1.15), both of which are wrong for a library whose entire purpose is representing Nepal dates
    • All four now apply the explicit NEPAL_UTC_OFFSET_MS shift before reading the value, so they always reflect Nepal Standard Time (UTC+05:45) regardless of the host machine's own timezone
  • startOfDay() / endOfDay() Now Anchor to Nepal Midnight
    • Previously used Date.prototype.setHours(), which reads and writes in the host's local timezone and could land the result on a different BS day depending on server configuration
    • Now clones the instance and computes the true UTC instant corresponding to 00:00:00.000 / 23:59:59.999 Nepal local time directly, without re-deriving the BS day, so the day never shifts and results are deterministic across hosts

Migration Notes

  • ⚠️ getHours(), getMinutes(), getSeconds(), getDay(), and startOfDay()/endOfDay() now report Nepal Standard Time (UTC+05:45) instead of the host's local time or raw UTC. getEnglishDate()/getTime() for startOfDay()/endOfDay() now return the true Gregorian instant matching Nepal midnight, which is 18:15/18:14:59.999 UTC on the previous/same Gregorian day rather than 00:00:00/23:59:59.999 UTC — update any code that string-compares or serializes these directly.
  • BS dates derived from the current moment (new NepaliDate(), or any Date within roughly 5 hours 45 minutes of a UTC day boundary) may now report a different, correct day, since day derivation is Nepal-timezone-aware rather than pure UTC.

[1.1.15] - 2026-07-26

Fixed

  • addMonths Off-By-One-Year Bug
    • Removed an erroneous year decrement that fired whenever the target month underflowed past December
    • Adding months across a year boundary now lands on the correct year
  • maximum() Static Method
    • Corrected the day offset used to compute the maximum supported date
    • Previously returned a date one day past the actual last supported day, which could fail to round-trip back into a NepaliDate
  • getDay() Timezone Independence
    • Weekday is now computed with getUTCDay() instead of the host's local day
    • Ensures consistent weekday results regardless of the machine's timezone

Changed

  • Broader Node.js Support
    • Widened the supported engine range from >=24.0.0 <25.0.0 to >=8
    • Updated esbuild build targets accordingly (node8 for CJS, es2019 for ESM)
  • Conversion Error Handling
    • ADtoBS and BStoAD now throw a dedicated DateConversionError (carries the original error as .cause) instead of a generic Error
    • Removed the console.error side effect that previously fired on conversion failure
  • Dependency Updates
    • Upgraded ESLint, TypeScript, Vitest, Babel, and related tooling to their latest major versions

Migration Notes

  • getDay() and weekday-derived output (e.g. getDayName(), calendar generation) may shift by one day for users in timezones behind UTC where local-time weekday previously differed from the UTC weekday. Time-of-day getters (getHours, getMinutes, getSeconds, getMilliseconds) and startOfDay()/endOfDay() remain local-time as before.

[1.1.14] - 2026-03-16

Added

  • daysInMonth Method Enhancement
    • Added optional year and month parameters to daysInMonth method

    • Allows checking days in any Nepali month without creating a new instance

    • Example usage:

      javascript
      // Gets Month and Date from instance
      const days = NepaliDate().daysInMonth();
      
      // Gets Month and Date from parameters and can be used statically
      const days = NepaliDate.daysInMonth(2081, 5);
  • GitHub Issue and Pull Request Templates
    • Added issue template for bug reports
    • Added issue template for feature requests
    • Added pull request template for standardized contributions
    • Improves contributor experience and issue tracking

Fixed

  • addYears Method Logic
    • Fixed incorrect year calculation when adding years
    • Properly handles edge cases with month/day overflow
    • Ensures valid dates after year addition
  • isLeapYear Method Logic
    • Corrected leap year detection for Nepali calendar
    • Fixed edge cases in leap year calculation
    • More accurate year validation
  • endOfWeek Parameter Validation
    • Added proper parameter validation for endOfWeek method
    • Prevents invalid input from causing errors
    • Better error messages for incorrect usage

Changed

  • NepaliDate Method Reordering
    • Reorganized method definitions for better code readability
    • Grouped related methods together
    • Improved internal code structure (no API changes)

Migration Notes

  • ✅ No breaking changes. This release is 100% backward compatible.

Released under the MIT License.