Skip to content

Commit b5fc3d1

Browse files
committed
fix: add isBetween API & update
update german locale, add romanian locale
1 parent 11428ff commit b5fc3d1

10 files changed

+91
-1
lines changed

docs/en/API-reference.md

+7
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ The `Dayjs` object is immutable, that is, all API operations that change the `Da
4949
- [RelativeTime](#relativetime)
5050
- [IsLeapYear](#isleapyear)
5151
- [WeekOfYear](#weekofyear)
52+
- [IsBetween](#isbetween)
5253

5354
## Parsing
5455

@@ -421,3 +422,9 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear)
421422
`.week` to get week of the year
422423

423424
plugin [`WeekOfYear`](./Plugin.md#weekofyear)
425+
426+
### IsBetween
427+
428+
`.isBetween` to check if a date is between two other dates
429+
430+
plugin [`IsBetween`](./Plugin.md#isbetween)

docs/en/Plugin.md

+11
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,17 @@ dayjs.extend(weekOfYear)
155155
dayjs('06/27/2018').week() // 26
156156
```
157157

158+
### IsBetween
159+
- IsBetween adds `.isBetween()` API to returns a `boolean` indicating if a date is between two other dates.
160+
161+
```javascript
162+
import isBetween from 'dayjs/plugin/isBetween'
163+
164+
dayjs.extend(isBetween)
165+
166+
dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25')); // true
167+
```
168+
158169
## Customize
159170

160171
You could build your own Day.js plugin to meet different needs.

docs/ja/API-reference.md

+7
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Day.js は組み込みの `Date.prototype` を変更する代わりに `Dayjs`
4747
* [RelativeTime](#relativetime)
4848
* [IsLeapYear](#isleapyear)
4949
* [WeekOfYear](#weekofyear)
50+
* [IsBetween](#isbetween)
5051

5152
---
5253

@@ -492,3 +493,9 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear)
492493
`.week` to get week of the year
493494

494495
plugin [`WeekOfYear`](./Plugin.md#weekofyear)
496+
497+
### IsBetween
498+
499+
`.isBetween` to check if a date is between two other dates
500+
501+
plugin [`IsBetween`](./Plugin.md#isbetween)

docs/ja/Plugin.md

+11
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,17 @@ dayjs.extend(weekOfYear)
156156
dayjs('06/27/2018').week() // 26
157157
```
158158

159+
### IsBetween
160+
- IsBetween adds `.isBetween()` API to returns a `boolean` indicating if a date is between two other dates.
161+
162+
```javascript
163+
import isBetween from 'dayjs/plugin/isBetween'
164+
165+
dayjs.extend(isBetween)
166+
167+
dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25')); // true
168+
```
169+
159170
## カスタマイズ
160171

161172
さまざまなニーズに合わせて独自の Day.js プラグインを構築することができます。

docs/ko/API-reference.md

+7
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ Day.js는 네이티브 `Date.prototype`을 수정하는 대신 `Dayjs` 오브젝
4949
- [RelativeTime](#relativetime)
5050
- [IsLeapYear](#isleapyear)
5151
- [WeekOfYear](#weekofyear)
52+
- [IsBetween](#isbetween)
5253

5354
## Parsing
5455

@@ -421,3 +422,9 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear)
421422
`.week` to get week of the year
422423

423424
plugin [`WeekOfYear`](./Plugin.md#weekofyear)
425+
426+
### IsBetween
427+
428+
`.isBetween` to check if a date is between two other dates
429+
430+
plugin [`IsBetween`](./Plugin.md#isbetween)

docs/ko/Plugin.md

+11
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,17 @@ dayjs.extend(weekOfYear)
155155
dayjs('06/27/2018').week() // 26
156156
```
157157

158+
### IsBetween
159+
- IsBetween adds `.isBetween()` API to returns a `boolean` indicating if a date is between two other dates.
160+
161+
```javascript
162+
import isBetween from 'dayjs/plugin/isBetween'
163+
164+
dayjs.extend(isBetween)
165+
166+
dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25')); // true
167+
```
168+
158169
## Customize
159170

160171
다양한 요구를 충족하기위해 자신만의 Day.js 플러그인을 만들 수 있습니다.

docs/pt-br/API-reference.md

+7
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ Este objeto `Dayjs` é imutável, ou seja, todas as operações desta API irão
4747
* [RelativeTime](#relativetime)
4848
* [IsLeapYear](#isleapyear)
4949
* [WeekOfYear](#weekofyear)
50+
* [IsBetween](#isbetween)
5051

5152
---
5253
O Day.js sempre irá retornar um novo objeto `Dayjs` se nada for especificado.
@@ -470,3 +471,9 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear)
470471
`.week` to get week of the year
471472

472473
plugin [`WeekOfYear`](./Plugin.md#weekofyear)
474+
475+
### IsBetween
476+
477+
`.isBetween` to check if a date is between two other dates
478+
479+
plugin [`IsBetween`](./Plugin.md#isbetween)

docs/pt-br/Plugin.md

+11
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,17 @@ dayjs.extend(weekOfYear)
155155
dayjs('06/27/2018').week() // 26
156156
```
157157

158+
### IsBetween
159+
- IsBetween adds `.isBetween()` API to returns a `boolean` indicating if a date is between two other dates.
160+
161+
```javascript
162+
import isBetween from 'dayjs/plugin/isBetween'
163+
164+
dayjs.extend(isBetween)
165+
166+
dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25')); // true
167+
```
168+
158169
## Customizar
159170

160171
Você também pode construir seu próprio plugin Day.js para diferentes necessidades. Sinta-se à vontade para abrir um pull request e compartilhar seu plugin com a comunidade.

docs/zh-cn/API-reference.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
* [相对时间](#relativetime)
4848
* [是否是闰年](#是否是闰年)
4949
* [年中的第几周](#年中的第几周)
50+
* [是否之间](#isbetween)
5051

5152
---
5253
如果没有特别说明,Day.js 的返回值都是新的 `Dayjs` 对象。
@@ -370,4 +371,10 @@ dayjs.isDayjs(new Date()); // false
370371

371372
`.week` 获取是第几个周
372373

373-
插件 [`WeekOfYear`](./Plugin.md#weekofyear)
374+
插件 [`WeekOfYear`](./Plugin.md#weekofyear)
375+
376+
### 是否之间
377+
378+
`.isBetween` 返回一个时间是否介于两个时间之间
379+
380+
plugin [`IsBetween`](./Plugin.md#isbetween)

docs/zh-cn/Plugin.md

+11
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,17 @@ dayjs.extend(weekOfYear)
155155
dayjs('06/27/2018').week() // 26
156156
```
157157

158+
### IsBetween
159+
- IsBetween 增加了 `.isBetween()` API 返回一个 `boolean` 来展示一个时间是否介于两个时间之间.
160+
161+
```javascript
162+
import isBetween from 'dayjs/plugin/isBetween'
163+
164+
dayjs.extend(isBetween)
165+
166+
dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25')); // true
167+
```
168+
158169
## 自定义
159170

160171
你可以根据需要自由的编写一个Day.js插件

0 commit comments

Comments
 (0)