Skip to content

Commit

Permalink
Merge pull request #267 from iamkun/feature/iamkun
Browse files Browse the repository at this point in the history
DEPRECATED isLeapYear and move to plugin
  • Loading branch information
iamkun authored Jul 4, 2018
2 parents 2836fe5 + 322b42b commit 24cab19
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 67 deletions.
10 changes: 0 additions & 10 deletions docs/en/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,16 +389,6 @@ dayjs.isDayjs(dayjs()); // true
dayjs.isDayjs(new Date()); // false
```

### Is Leap Year `.isLeapYear()`

**[DEPRECATED] in 1.7.0, use [`IsLeapYear plugin`](./Plugin.md#isleapyear) instead**

Returns a `boolean` indicating whether the `Dayjs`'s year is a leap year or not.

```js
dayjs('2000-01-01').isLeapYear(); // true
```

## Plugin APIs

### RelativeTime
Expand Down
13 changes: 0 additions & 13 deletions docs/ja/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,19 +460,6 @@ dayjs.isDayjs(dayjs()); // true
dayjs.isDayjs(new Date()); // false
```

#### Is Leap Year

**[DEPRECATED] in 1.7.0, use [`IsLeapYear plugin`](./Plugin.md#isleapyear) instead**

* Boolean を返します

その年がうるう年かどうかをチェックします。

```js
dayjs().isLeapYear();
dayjs('2000-01-01').isLeapYear(); // true
```

## Plugin APIs

### RelativeTime
Expand Down
10 changes: 0 additions & 10 deletions docs/ko/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,16 +389,6 @@ dayjs.isDayjs(dayjs()); // true
dayjs.isDayjs(new Date()); // false
```

### Is Leap Year `.isLeapYear()`

**[DEPRECATED] in 1.7.0, use [`IsLeapYear plugin`](./Plugin.md#isleapyear) instead**

`Dayjs` 값이 윤년인지를 확인합니다. 반환 타입은 `boolean` 입니다.

```js
dayjs('2000-01-01').isLeapYear(); // true
```

## Plugin APIs

### RelativeTime
Expand Down
13 changes: 0 additions & 13 deletions docs/pt-br/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,19 +438,6 @@ dayjs.isDayjs(dayjs()); // true
dayjs.isDayjs(new Date()); // false
```

#### Ano Bissexto

**[DEPRECATED] in 1.7.0, use [`IsLeapYear plugin`](./Plugin.md#isleapyear) instead**

* retorna um Boolean

Se um ano é bissexto.

```js
dayjs().isLeapYear();
dayjs('2000-01-01').isLeapYear(); // true
```

## Plugin APIs

### RelativeTime
Expand Down
12 changes: 0 additions & 12 deletions docs/zh-cn/API-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,18 +338,6 @@ dayjs.isDayjs(dayjs()); // true
dayjs.isDayjs(new Date()); // false
```

#### 是否闰年

**[已废弃] 将在 1.7.0 废弃, 使用 [`IsLeapYear 插件`](./Plugin.md#isleapyear) 代替**

- return Boolean

是否闰年。
```js
dayjs().isLeapYear();
dayjs('2000-01-01').isLeapYear(); // true
```

## 插件 APIs

### 相对时间
Expand Down
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 24cab19

Please sign in to comment.