Skip to content

Commit 59e2846

Browse files
committed
feat: add support for node 22 and remove 16
1 parent c85edfa commit 59e2846

File tree

10 files changed

+4261
-3191
lines changed

10 files changed

+4261
-3191
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@ Please provide a clear and concise description of your expected outcome.
1717

1818
**Environment**
1919

20-
- npm/node version:
21-
- Package version:
22-
- Operating system:
23-
- Any other relevant information about your environment.
20+
- npm/node version:
21+
- Package version:
22+
- Operating system:
23+
- Any other relevant information about your environment.
2424

2525
**Additional context**
2626
Please provide any additional context or information that may be helpful in understanding and resolving the issue. This can include:
2727

28-
- Error stack trace
29-
- Error messages
30-
- Log files
31-
- Screenshots
32-
- Any other relevant details related to the issue.
28+
- Error stack trace
29+
- Error messages
30+
- Log files
31+
- Screenshots
32+
- Any other relevant details related to the issue.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@
1010

1111
Please mark the appropriate option below to describe the type of change your pull request introduces:
1212

13-
- [ ] Bug fix
14-
- [ ] New feature
15-
- [ ] Enhancement
16-
- [ ] Documentation update
17-
- [ ] Refactor
18-
- [ ] Other (please specify)
13+
- [ ] Bug fix
14+
- [ ] New feature
15+
- [ ] Enhancement
16+
- [ ] Documentation update
17+
- [ ] Refactor
18+
- [ ] Other (please specify)
1919

2020
## Checklist
2121

22-
- [ ] I have added/updated the necessary documentation on `README.md`.
23-
- [ ] I have added appropriate test cases (if applicable) to ensure the changes are functioning correctly.
24-
- [ ] My pull request has a clear title and description.
22+
- [ ] I have added/updated the necessary documentation on `README.md`.
23+
- [ ] I have added appropriate test cases (if applicable) to ensure the changes are functioning correctly.
24+
- [ ] My pull request has a clear title and description.
2525

2626
## Additional Notes
2727

.github/SECURITY.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ If you discover a security vulnerability within the project, we encourage you to
3131

3232
Upon receiving a security vulnerability report, our team will evaluate the issue and take appropriate actions to address it. This may include:
3333

34-
- Developing and testing a patch or fix for the vulnerability
35-
- Coordinating with the reporter or other relevant parties to verify the vulnerability and its impact
36-
- Releasing a new version that includes the necessary security fixes
34+
- Developing and testing a patch or fix for the vulnerability
35+
- Coordinating with the reporter or other relevant parties to verify the vulnerability and its impact
36+
- Releasing a new version that includes the necessary security fixes
3737

3838
We strive to provide security updates in a timely manner and communicate any necessary steps for users to upgrade to the latest secure version.
3939

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ name: Github CI
55

66
on:
77
push:
8-
branches: ['main']
8+
branches: ['main', '99-node-16-no-longer-supported']
99
pull_request:
1010

1111
jobs:
@@ -14,7 +14,7 @@ jobs:
1414

1515
strategy:
1616
matrix:
17-
node-version: [16.x, 18.x, 20.x]
17+
node-version: [18, 20, 22]
1818
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
1919

2020
steps:

.github/workflows/release-please.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Setup node
2929
uses: actions/setup-node@v4
3030
with:
31-
node-version: 16
31+
node-version: 22
3232
registry-url: 'https://registry.npmjs.org'
3333
if: ${{ steps.release.outputs.release_created }}
3434

.husky/commit-msg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
npx --no-install commitlint --edit $1

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,2 @@
1-
#!/usr/bin/env sh
2-
. "$(dirname -- "$0")/_/husky.sh"
3-
41
npx lint-staged
52
npm run test

README.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -60,41 +60,41 @@ The `NepaliDate` class represents a Nepali calendar date. It provides various me
6060

6161
You can create a `NepaliDate` object in several ways:
6262

63-
- Without any parameters: Creates a `NepaliDate` object for the current date and time.
63+
- Without any parameters: Creates a `NepaliDate` object for the current date and time.
6464

6565
```javascript
6666
import NepaliDate from 'nepali-datetime'
6767

6868
const now = new NepaliDate()
6969
```
7070

71-
- Using a Nepali date string: Parses the string as a Nepali calendar date.
71+
- Using a Nepali date string: Parses the string as a Nepali calendar date.
7272

7373
```javascript
7474
const date1 = new NepaliDate('2079-02-15')
7575
const date2 = new NepaliDate('2079-02-15 14:00')
7676
```
7777

78-
- Using a Unix timestamp (in milliseconds):
78+
- Using a Unix timestamp (in milliseconds):
7979

8080
```javascript
8181
const date2 = new NepaliDate(1654210800000)
8282
```
8383

84-
- Using a JavaScript `Date` object: Converts the JavaScript `Date` object to a `NepaliDate` object.
84+
- Using a JavaScript `Date` object: Converts the JavaScript `Date` object to a `NepaliDate` object.
8585

8686
```javascript
8787
const jsDate = new Date()
8888
const date3 = new NepaliDate(jsDate)
8989
```
9090

91-
- Using an existing `NepaliDate` object: Creates a new `NepaliDate` object with the same values.
91+
- Using an existing `NepaliDate` object: Creates a new `NepaliDate` object with the same values.
9292

9393
```javascript
9494
const date4 = new NepaliDate(date3)
9595
```
9696

97-
- Using Nepali calendar date and time parameters: Specifies the components of a Nepali calendar date.
97+
- Using Nepali calendar date and time parameters: Specifies the components of a Nepali calendar date.
9898

9999
```javascript
100100
const date5 = new NepaliDate(year, month, date, hour, minute, second, ms)
@@ -105,42 +105,42 @@ You can create a `NepaliDate` object in several ways:
105105

106106
You can retrieve various components of a `NepaliDate` object using the following methods:
107107

108-
- `getDateObject()`: Retrieves the Javascript Date object equivalent to the NepaliDate.
109-
- `getTime()`: Retrieves the Unix timestamp (in milliseconds) of the Nepali date.
110-
- `getYear()`: Retrieves the year of the Nepali date in the Nepali calendar.
111-
- `getEnglishYear()`: Retrieves the year of the Nepali date in the English calendar.
112-
- `getMonth()`: Retrieves the month of the Nepali date in the Nepali calendar.
113-
- `getEnglishMonth()`: Retrieves the month of the Nepali date in the English calendar.
114-
- `getDate()`: Retrieves the day of the month of the Nepali date in the Nepali calendar.
115-
- `getEnglishDate()`: Retrieves the day of the month of the Nepali date in the English calendar.
116-
- `getDay()`: Retrieves the day of the week represented by a numeric value.
117-
- `getHours()`: Retrieves the hour value of the Nepali date.
118-
- `getMinutes()`: Retrieves the minute value of the Nepali date.
119-
- `getSeconds()`: Retrieves the second value of the Nepali date.
120-
- `getMilliseconds()`: Retrieves the millisecond value of the Nepali date.
108+
- `getDateObject()`: Retrieves the Javascript Date object equivalent to the NepaliDate.
109+
- `getTime()`: Retrieves the Unix timestamp (in milliseconds) of the Nepali date.
110+
- `getYear()`: Retrieves the year of the Nepali date in the Nepali calendar.
111+
- `getEnglishYear()`: Retrieves the year of the Nepali date in the English calendar.
112+
- `getMonth()`: Retrieves the month of the Nepali date in the Nepali calendar.
113+
- `getEnglishMonth()`: Retrieves the month of the Nepali date in the English calendar.
114+
- `getDate()`: Retrieves the day of the month of the Nepali date in the Nepali calendar.
115+
- `getEnglishDate()`: Retrieves the day of the month of the Nepali date in the English calendar.
116+
- `getDay()`: Retrieves the day of the week represented by a numeric value.
117+
- `getHours()`: Retrieves the hour value of the Nepali date.
118+
- `getMinutes()`: Retrieves the minute value of the Nepali date.
119+
- `getSeconds()`: Retrieves the second value of the Nepali date.
120+
- `getMilliseconds()`: Retrieves the millisecond value of the Nepali date.
121121

122122
#### Setting the Nepali date components
123123

124124
You can set individual components of a `NepaliDate` object using the following methods:
125125

126-
- `setYear(year)`: Sets the year of the Nepali date.
127-
- `setMonth(month)`: Sets the month of the Nepali date.
128-
- `setDate(day)`: Sets the day of the month of the Nepali date.
129-
- `setHours(hour)`: Sets the hour of the Nepali date.
130-
- `setMinutes(minute)`: Sets the minute of the Nepali date.
131-
- `setSeconds(second)`: Sets the second of the Nepali date.
132-
- `setMilliseconds(ms)`: Sets the millisecond of the Nepali date.
133-
- `setTime(time)`: Sets the Nepali date and time values using a Unix timestamp.
126+
- `setYear(year)`: Sets the year of the Nepali date.
127+
- `setMonth(month)`: Sets the month of the Nepali date.
128+
- `setDate(day)`: Sets the day of the month of the Nepali date.
129+
- `setHours(hour)`: Sets the hour of the Nepali date.
130+
- `setMinutes(minute)`: Sets the minute of the Nepali date.
131+
- `setSeconds(second)`: Sets the second of the Nepali date.
132+
- `setMilliseconds(ms)`: Sets the millisecond of the Nepali date.
133+
- `setTime(time)`: Sets the Nepali date and time values using a Unix timestamp.
134134

135135
#### Formatting the Nepali date
136136

137137
You can format a `NepaliDate` object as a string using the `format()` and `formatNepali()` methods.
138138
Additionally, you can convert the corresponding English date to a string using the `formatEnglishDate()` and `formatEnglishDateInNepali()` methods.
139139

140-
- `format(formatStr)`: Returns a string representation (in English) of the `NepaliDate` object in the specified format.
141-
- `formatNepali(formatStr)`: Returns a string representation in the Nepali (Devanagari script) of the `NepaliDate` object in the specified format.
142-
- `formatEnglishDate(formatStr)`: Returns a string representation (in English) of the English Date in the specified format.
143-
- `formatEnglishDateInNepali(formatStr)`: Returns a string representation in the Nepali (Devanagari script) of the English Date in the specified format.
140+
- `format(formatStr)`: Returns a string representation (in English) of the `NepaliDate` object in the specified format.
141+
- `formatNepali(formatStr)`: Returns a string representation in the Nepali (Devanagari script) of the `NepaliDate` object in the specified format.
142+
- `formatEnglishDate(formatStr)`: Returns a string representation (in English) of the English Date in the specified format.
143+
- `formatEnglishDateInNepali(formatStr)`: Returns a string representation in the Nepali (Devanagari script) of the English Date in the specified format.
144144

145145
```javascript
146146
const date = new NepaliDate(2079, 5, 3, 16, 14)
@@ -217,14 +217,14 @@ console.log(date2.toString()) // 2080-03-23 10:15:00
217217

218218
#### Others
219219

220-
- `NepaliDate.getDaysOfMonth(year, month)`: Returns the number of days in a specific month of a given year.
220+
- `NepaliDate.getDaysOfMonth(year, month)`: Returns the number of days in a specific month of a given year.
221221

222222
### dateConverter
223223

224224
The `dateConverter` module provides core functions for converting dates between the Nepali and English calendars.
225225

226-
- `englishToNepali(year, month, day)`: Converts an English calendar date to a Nepali calendar date. Returns an array `[npYear, npMonth, npDay]` representing the Nepali date.
227-
- `nepaliToEnglish(year, month, day)`: Converts a Nepali calendar date to an English calendar date. Returns an array `[enYear, enYear, enDay]` representing the English date.
226+
- `englishToNepali(year, month, day)`: Converts an English calendar date to a Nepali calendar date. Returns an array `[npYear, npMonth, npDay]` representing the Nepali date.
227+
- `nepaliToEnglish(year, month, day)`: Converts a Nepali calendar date to an English calendar date. Returns an array `[enYear, enYear, enDay]` representing the English date.
228228

229229
> Note: Use 0 as the value for the months Baisakh and January (Javascript Logic 🤷).
230230

0 commit comments

Comments
 (0)