Skip to content

Commit

Permalink
fix: DEPRECATED isLeapYear, use IsLeapYear plugin instead
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkun committed Jul 4, 2018
1 parent 2836fe5 commit e2e5116
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
4 changes: 0 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,6 @@ class Dayjs {
return !(this.$d.toString() === 'Invalid Date')
}

isLeapYear() {
return ((this.$y % 4 === 0) && (this.$y % 100 !== 0)) || (this.$y % 400 === 0)
}

$compare(that) {
return this.valueOf() - dayjs(that).valueOf()
}
Expand Down
5 changes: 0 additions & 5 deletions test/query.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ afterEach(() => {

const testArr = [dayjs, moment]

it('IsLeapYear', () => {
expect(dayjs('20000101').isLeapYear()).toBe(true)
expect(dayjs('2100-01-01').isLeapYear()).toBe(false)
})

describe('Is Before Is After Is Same', () => {
it('Compare to dayjs object', () => {
testArr.forEach((instance) => {
Expand Down

0 comments on commit e2e5116

Please sign in to comment.