@remotemerge/nepali-date-converter
Version:
A modern JavaScript library for seamless conversion between Bikram Sambat (BS) and Gregorian (AD) dates. Easily convert Nepali dates to English dates and vice versa with support for years 1975 BS to 2099 BS.
27 lines (26 loc) • 605 B
TypeScript
export default class DateConverter {
private readonly startDate;
private readonly endDate;
private readonly dateRangeError;
private readonly inputYear;
private readonly inputMonth;
private readonly inputDate;
constructor(strDate: string);
private parseDateString;
private numToEn;
private numToDay;
private getAdDate;
private getBsDate;
toAd(): {
year: number;
month: number;
date: number;
day: string;
};
toBs(): {
day: string;
year: number;
month: number;
date: number;
};
}