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 realDatepassed 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_MSconstant; 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
- The current Nepali date (
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_MSshift before reading the value, so they always reflect Nepal Standard Time (UTC+05:45) regardless of the host machine's own timezone
- Previously read the host's local time (
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
- Previously used
Migration Notes
- ⚠️
getHours(),getMinutes(),getSeconds(),getDay(), andstartOfDay()/endOfDay()now report Nepal Standard Time (UTC+05:45) instead of the host's local time or raw UTC.getEnglishDate()/getTime()forstartOfDay()/endOfDay()now return the true Gregorian instant matching Nepal midnight, which is18:15/18:14:59.999UTC on the previous/same Gregorian day rather than00:00:00/23:59:59.999UTC — update any code that string-compares or serializes these directly. - BS dates derived from the current moment (
new NepaliDate(), or anyDatewithin 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
addMonthsOff-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
- Weekday is now computed with
Changed
- Broader Node.js Support
- Widened the supported engine range from
>=24.0.0 <25.0.0to>=8 - Updated esbuild build targets accordingly (
node8for CJS,es2019for ESM)
- Widened the supported engine range from
- Conversion Error Handling
ADtoBSandBStoADnow throw a dedicatedDateConversionError(carries the original error as.cause) instead of a genericError- Removed the
console.errorside 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) andstartOfDay()/endOfDay()remain local-time as before.
[1.1.14] - 2026-03-16
Added
daysInMonthMethod EnhancementAdded optional
yearandmonthparameters todaysInMonthmethodAllows 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
addYearsMethod Logic- Fixed incorrect year calculation when adding years
- Properly handles edge cases with month/day overflow
- Ensures valid dates after year addition
isLeapYearMethod Logic- Corrected leap year detection for Nepali calendar
- Fixed edge cases in leap year calculation
- More accurate year validation
endOfWeekParameter Validation- Added proper parameter validation for
endOfWeekmethod - Prevents invalid input from causing errors
- Better error messages for incorrect usage
- Added proper parameter validation for
Changed
NepaliDateMethod 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.