Skip to content

Commit e2e5116

Browse files
committed
fix: DEPRECATED isLeapYear, use IsLeapYear plugin instead
1 parent 2836fe5 commit e2e5116

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

src/index.js

-4
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,6 @@ class Dayjs {
9292
return !(this.$d.toString() === 'Invalid Date')
9393
}
9494

95-
isLeapYear() {
96-
return ((this.$y % 4 === 0) && (this.$y % 100 !== 0)) || (this.$y % 400 === 0)
97-
}
98-
9995
$compare(that) {
10096
return this.valueOf() - dayjs(that).valueOf()
10197
}

test/query.test.js

-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,6 @@ afterEach(() => {
1212

1313
const testArr = [dayjs, moment]
1414

15-
it('IsLeapYear', () => {
16-
expect(dayjs('20000101').isLeapYear()).toBe(true)
17-
expect(dayjs('2100-01-01').isLeapYear()).toBe(false)
18-
})
19-
2015
describe('Is Before Is After Is Same', () => {
2116
it('Compare to dayjs object', () => {
2217
testArr.forEach((instance) => {

0 commit comments

Comments
 (0)