diff --git a/docs/en/API-reference.md b/docs/en/API-reference.md index daba03a97..c3911a2d9 100644 --- a/docs/en/API-reference.md +++ b/docs/en/API-reference.md @@ -49,6 +49,7 @@ The `Dayjs` object is immutable, that is, all API operations that change the `Da - [RelativeTime](#relativetime) - [IsLeapYear](#isleapyear) - [WeekOfYear](#weekofyear) + - [IsBetween](#isbetween) ## Parsing @@ -421,3 +422,9 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear) `.week` to get week of the year plugin [`WeekOfYear`](./Plugin.md#weekofyear) + +### IsBetween + +`.isBetween` to check if a date is between two other dates + +plugin [`IsBetween`](./Plugin.md#isbetween) diff --git a/docs/en/Plugin.md b/docs/en/Plugin.md index 0d2ff590b..2b8221655 100644 --- a/docs/en/Plugin.md +++ b/docs/en/Plugin.md @@ -155,6 +155,17 @@ dayjs.extend(weekOfYear) dayjs('06/27/2018').week() // 26 ``` +### IsBetween + - IsBetween adds `.isBetween()` API to returns a `boolean` indicating if a date is between two other dates. + +```javascript +import isBetween from 'dayjs/plugin/isBetween' + +dayjs.extend(isBetween) + +dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25')); // true +``` + ## Customize You could build your own Day.js plugin to meet different needs. diff --git a/docs/ja/API-reference.md b/docs/ja/API-reference.md index e7b496374..e66825f95 100644 --- a/docs/ja/API-reference.md +++ b/docs/ja/API-reference.md @@ -47,6 +47,7 @@ Day.js は組み込みの `Date.prototype` を変更する代わりに `Dayjs` * [RelativeTime](#relativetime) * [IsLeapYear](#isleapyear) * [WeekOfYear](#weekofyear) + * [IsBetween](#isbetween) --- @@ -492,3 +493,9 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear) `.week` to get week of the year plugin [`WeekOfYear`](./Plugin.md#weekofyear) + +### IsBetween + +`.isBetween` to check if a date is between two other dates + +plugin [`IsBetween`](./Plugin.md#isbetween) diff --git a/docs/ja/Plugin.md b/docs/ja/Plugin.md index aaefb769b..2d487a23c 100644 --- a/docs/ja/Plugin.md +++ b/docs/ja/Plugin.md @@ -156,6 +156,17 @@ dayjs.extend(weekOfYear) dayjs('06/27/2018').week() // 26 ``` +### IsBetween + - IsBetween adds `.isBetween()` API to returns a `boolean` indicating if a date is between two other dates. + +```javascript +import isBetween from 'dayjs/plugin/isBetween' + +dayjs.extend(isBetween) + +dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25')); // true +``` + ## カスタマイズ さまざまなニーズに合わせて独自の Day.js プラグインを構築することができます。 diff --git a/docs/ko/API-reference.md b/docs/ko/API-reference.md index c7efa74e7..82d2ce370 100644 --- a/docs/ko/API-reference.md +++ b/docs/ko/API-reference.md @@ -49,6 +49,7 @@ Day.js는 네이티브 `Date.prototype`을 수정하는 대신 `Dayjs` 오브젝 - [RelativeTime](#relativetime) - [IsLeapYear](#isleapyear) - [WeekOfYear](#weekofyear) + - [IsBetween](#isbetween) ## Parsing @@ -421,3 +422,9 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear) `.week` to get week of the year plugin [`WeekOfYear`](./Plugin.md#weekofyear) + +### IsBetween + +`.isBetween` to check if a date is between two other dates + +plugin [`IsBetween`](./Plugin.md#isbetween) diff --git a/docs/ko/Plugin.md b/docs/ko/Plugin.md index c6f7bb3c8..4a316b079 100644 --- a/docs/ko/Plugin.md +++ b/docs/ko/Plugin.md @@ -155,6 +155,17 @@ dayjs.extend(weekOfYear) dayjs('06/27/2018').week() // 26 ``` +### IsBetween + - IsBetween adds `.isBetween()` API to returns a `boolean` indicating if a date is between two other dates. + +```javascript +import isBetween from 'dayjs/plugin/isBetween' + +dayjs.extend(isBetween) + +dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25')); // true +``` + ## Customize 다양한 요구를 충족하기위해 자신만의 Day.js 플러그인을 만들 수 있습니다. diff --git a/docs/pt-br/API-reference.md b/docs/pt-br/API-reference.md index a98bfdf9e..d926058ed 100644 --- a/docs/pt-br/API-reference.md +++ b/docs/pt-br/API-reference.md @@ -47,6 +47,7 @@ Este objeto `Dayjs` é imutável, ou seja, todas as operações desta API irão * [RelativeTime](#relativetime) * [IsLeapYear](#isleapyear) * [WeekOfYear](#weekofyear) + * [IsBetween](#isbetween) --- O Day.js sempre irá retornar um novo objeto `Dayjs` se nada for especificado. @@ -470,3 +471,9 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear) `.week` to get week of the year plugin [`WeekOfYear`](./Plugin.md#weekofyear) + +### IsBetween + +`.isBetween` to check if a date is between two other dates + +plugin [`IsBetween`](./Plugin.md#isbetween) diff --git a/docs/pt-br/Plugin.md b/docs/pt-br/Plugin.md index c1fff9045..3aab98ea7 100644 --- a/docs/pt-br/Plugin.md +++ b/docs/pt-br/Plugin.md @@ -155,6 +155,17 @@ dayjs.extend(weekOfYear) dayjs('06/27/2018').week() // 26 ``` +### IsBetween + - IsBetween adds `.isBetween()` API to returns a `boolean` indicating if a date is between two other dates. + +```javascript +import isBetween from 'dayjs/plugin/isBetween' + +dayjs.extend(isBetween) + +dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25')); // true +``` + ## Customizar 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. diff --git a/docs/zh-cn/API-reference.md b/docs/zh-cn/API-reference.md index 2a2d62b76..48340ebee 100644 --- a/docs/zh-cn/API-reference.md +++ b/docs/zh-cn/API-reference.md @@ -47,6 +47,7 @@ * [相对时间](#relativetime) * [是否是闰年](#是否是闰年) * [年中的第几周](#年中的第几周) + * [是否之间](#isbetween) --- 如果没有特别说明,Day.js 的返回值都是新的 `Dayjs` 对象。 @@ -370,4 +371,10 @@ dayjs.isDayjs(new Date()); // false `.week` 获取是第几个周 -插件 [`WeekOfYear`](./Plugin.md#weekofyear) \ No newline at end of file +插件 [`WeekOfYear`](./Plugin.md#weekofyear) + +### 是否之间 + +`.isBetween` 返回一个时间是否介于两个时间之间 + +plugin [`IsBetween`](./Plugin.md#isbetween) \ No newline at end of file diff --git a/docs/zh-cn/Plugin.md b/docs/zh-cn/Plugin.md index 959494674..bc1671949 100644 --- a/docs/zh-cn/Plugin.md +++ b/docs/zh-cn/Plugin.md @@ -155,6 +155,17 @@ dayjs.extend(weekOfYear) dayjs('06/27/2018').week() // 26 ``` +### IsBetween + - IsBetween 增加了 `.isBetween()` API 返回一个 `boolean` 来展示一个时间是否介于两个时间之间. + +```javascript +import isBetween from 'dayjs/plugin/isBetween' + +dayjs.extend(isBetween) + +dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25')); // true +``` + ## 自定义 你可以根据需要自由的编写一个Day.js插件