You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `dateConverter`module provides functions for converting dates between the Nepali and English calendars.
220
+
The `dateConverter`module provides core functions for converting dates between the Nepali and English calendars.
221
+
222
+
-`englishToNepali(year, month, day)`: Converts an English calendar date to a Nepali calendar date. Returns an array `[npYear, npMonth, npDay]` representing the Nepali date.
223
+
-`nepaliToEnglish(year, month, day)`: Converts a Nepali calendar date to an English calendar date. Returns an array `[enYear, enYear, enDay]` representing the English date.
218
224
219
-
-`englishToNepali(year, month, day)`: Converts an English calendar date to a Nepali calendar date. Returns an array `[yearNp, monthNp, dayNp]` representing the Nepali date.
220
-
-`nepaliToEnglish(year, month, day)`: Converts a Nepali calendar date to an English calendar date. Returns an array `[yearEn, monthEn, dayEn]` representing the English date.
225
+
> Note: Use 0 as the value for the months Baisakh and January (Javascript Logic 🤷).
221
226
222
227
```javascript
223
228
import dateConverter from 'nepali-datetime/dateConverter'
const enDate = new NepaliDate(npDate).formatEnglishDate('YYYY-MM-DD')
254
+
// 2024-11-25
255
+
```
256
+
232
257
## Acknowledgements
233
258
234
259
This project was inspired by [nepali-date](https://github.com/sharingapples/nepali-date). We would like to express our gratitude to their team for their excellent work and ideas, which served as a motivation for this project.
0 commit comments