this is a package to convert the date between ad and bs dates
npm install meropatro-dateconverterA javascript package to convert nepali date BS (Bikram Sambat) to AD and vice-versa. Also include a feature to calculate age in nepali date.
bash
npm install meropatro-dateconverter
`
Usage
`jsx
const { adToBs, bsToAd, calculateAge } = require("meropatro-dateconverter");
try {
const bsDate = adToBs("2078-03-05");
console.log(bsDate);
// to calculate age
const myAge = calculateAge("2070-10-10");
console.log(myAge);
} catch (e) {
console.log(e.message);
}
``
adToBs('YYYY-MM-DD') - convert AD to BS date
bsToAd('YYYY-MM-DD') - convert BS to AD date
calculateAge('YYYY-MM-DD') - calculate age from BS date.
YYYY - 4 digit of year (2078)
MM - month number with 0 padding - (01-12)
DD - Day of Month with zero padding (01-32)