From 71e4bff9d874eb6ac3447a06debc938bfc881554 Mon Sep 17 00:00:00 2001 From: iamkun Date: Thu, 28 Mar 2019 19:11:33 +0800 Subject: [PATCH] docs: Add IsoWeeksInYear docs --- docs/en/API-reference.md | 10 ++++++++-- docs/en/Plugin.md | 15 +++++++++++++++ docs/es-es/API-reference.md | 6 ++++++ docs/es-es/Plugin.md | 15 +++++++++++++++ docs/ja/API-reference.md | 6 ++++++ docs/ja/Plugin.md | 15 +++++++++++++++ docs/ko/API-reference.md | 6 ++++++ docs/ko/Plugin.md | 15 +++++++++++++++ docs/pt-br/API-reference.md | 6 ++++++ docs/pt-br/Plugin.md | 15 +++++++++++++++ docs/zh-cn/API-reference.md | 6 ++++++ docs/zh-cn/Plugin.md | 15 +++++++++++++++ 12 files changed, 128 insertions(+), 2 deletions(-) diff --git a/docs/en/API-reference.md b/docs/en/API-reference.md index 11389f3b2..a95bfe18f 100644 --- a/docs/en/API-reference.md +++ b/docs/en/API-reference.md @@ -445,6 +445,12 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear) plugin [`WeekOfYear`](./Plugin.md#weekofyear) +### IsoWeeksInYear + +`.isoWeeksInYear` to get the number of weeks in year + +plugin [`IsoWeeksInYear`](./Plugin.md#isoweeksinyear) + ### IsSameOrAfter `.isSameOrAfter` to check if a date is same of after another date @@ -477,12 +483,12 @@ plugin [`ToArray`](./Plugin.md#toarray) ### ToObject -`.toObject` to return an `object` with the date's properties. +`.toObject` to return an `object` with the date's properties plugin [`ToObject`](./Plugin.md#toobject) ### MinMax -`.min` `.max` to compare given dayjs instances. +`.min` `.max` to compare given dayjs instances plugin [`MinMax`](./Plugin.md#minmax) diff --git a/docs/en/Plugin.md b/docs/en/Plugin.md index c3bc92a8b..3df237257 100644 --- a/docs/en/Plugin.md +++ b/docs/en/Plugin.md @@ -282,6 +282,21 @@ dayjs('2018-06-27').week() // 26 dayjs('2018-06-27').week(5) // set week ``` +### IsoWeeksInYear + +- IsoWeeksInYear adds `.isoWeeksInYear()` API to return a `number` to get the number of weeks in year, according to ISO weeks. + +```javascript +import isoWeeksInYear from 'dayjs/plugin/isoWeeksInYear' +import isLeapYear from 'dayjs/plugin/isLeapYear' // rely on isLeapYear plugin + +dayjs.extend(isoWeeksInYear) +dayjs.extend(isLeapYear) + +dayjs('2004-01-01').isoWeeksInYear() // 53 +dayjs('2005-01-01').isoWeeksInYear() // 52 +``` + ### QuarterOfYear - QuarterOfYear adds `.quarter()` API to return to which quarter of the year belongs a date, and extends `.add` `.subtract` `.startOf` `.endOf` APIs to support unit `quarter`. diff --git a/docs/es-es/API-reference.md b/docs/es-es/API-reference.md index 03571033c..8d3b1a31e 100644 --- a/docs/es-es/API-reference.md +++ b/docs/es-es/API-reference.md @@ -445,6 +445,12 @@ complemento [`IsLeapYear`](./Plugin.md#isleapyear) complemento [`WeekOfYear`](./Plugin.md#weekofyear) +### IsoWeeksInYear + +`.isoWeeksInYear` to get the number of weeks in year + +plugin [`IsoWeeksInYear`](./Plugin.md#isoweeksinyear) + ### IsSameOrAfter `.isSameOrAfter` to check if a date is same of after another date diff --git a/docs/es-es/Plugin.md b/docs/es-es/Plugin.md index 04331ab1e..279c5c85c 100644 --- a/docs/es-es/Plugin.md +++ b/docs/es-es/Plugin.md @@ -282,6 +282,21 @@ dayjs('2018-06-27').week() // 26 dayjs('2018-06-27').week(5) // set week ``` +### IsoWeeksInYear + +- IsoWeeksInYear adds `.isoWeeksInYear()` API to return a `number` to get the number of weeks in year, according to ISO weeks. + +```javascript +import isoWeeksInYear from 'dayjs/plugin/isoWeeksInYear' +import isLeapYear from 'dayjs/plugin/isLeapYear' // rely on isLeapYear plugin + +dayjs.extend(isoWeeksInYear) +dayjs.extend(isLeapYear) + +dayjs('2004-01-01').isoWeeksInYear() // 53 +dayjs('2005-01-01').isoWeeksInYear() // 52 +``` + ### QuarterOfYear - QuarterOfYear add `.quarter()` API to return to which quarter of the year belongs a date, and extends `.add` `.subtract` `.startOf` `.endOf` APIs to support unit `quarter`. diff --git a/docs/ja/API-reference.md b/docs/ja/API-reference.md index 6b4325517..37fbcf409 100644 --- a/docs/ja/API-reference.md +++ b/docs/ja/API-reference.md @@ -501,6 +501,12 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear) plugin [`WeekOfYear`](./Plugin.md#weekofyear) +### IsoWeeksInYear + +`.isoWeeksInYear` to get the number of weeks in year + +plugin [`IsoWeeksInYear`](./Plugin.md#isoweeksinyear) + #### IsSameOrAfter `.isSameOrAfter` はある日付が別の日付と同じまたは以降かどうかを判定します。 diff --git a/docs/ja/Plugin.md b/docs/ja/Plugin.md index 57cf9c507..d29c57f63 100644 --- a/docs/ja/Plugin.md +++ b/docs/ja/Plugin.md @@ -291,6 +291,21 @@ dayjs('06/27/2018').week() // 26 dayjs('2018-06-27').week(5) // set week ``` +### IsoWeeksInYear + +- IsoWeeksInYear adds `.isoWeeksInYear()` API to return a `number` to get the number of weeks in year, according to ISO weeks. + +```javascript +import isoWeeksInYear from 'dayjs/plugin/isoWeeksInYear' +import isLeapYear from 'dayjs/plugin/isLeapYear' // rely on isLeapYear plugin + +dayjs.extend(isoWeeksInYear) +dayjs.extend(isLeapYear) + +dayjs('2004-01-01').isoWeeksInYear() // 53 +dayjs('2005-01-01').isoWeeksInYear() // 52 +``` + ### QuarterOfYear - QuarterOfYear add `.quarter()` API to return to which quarter of the year belongs a date, and extends `.add` `.subtract` `.startOf` `.endOf` APIs to support unit `quarter`. diff --git a/docs/ko/API-reference.md b/docs/ko/API-reference.md index 9f4260d54..a5f40ef0a 100644 --- a/docs/ko/API-reference.md +++ b/docs/ko/API-reference.md @@ -444,6 +444,12 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear) plugin [`WeekOfYear`](./Plugin.md#weekofyear) +### IsoWeeksInYear + +`.isoWeeksInYear` to get the number of weeks in year + +plugin [`IsoWeeksInYear`](./Plugin.md#isoweeksinyear) + ### IsSameOrAfter `.isSameOrAfter` to check if a date is same of after another date diff --git a/docs/ko/Plugin.md b/docs/ko/Plugin.md index ecc92586b..91a705870 100644 --- a/docs/ko/Plugin.md +++ b/docs/ko/Plugin.md @@ -283,6 +283,21 @@ dayjs('06/27/2018').week() // 26 dayjs('2018-06-27').week(5) // set week ``` +### IsoWeeksInYear + +- IsoWeeksInYear adds `.isoWeeksInYear()` API to return a `number` to get the number of weeks in year, according to ISO weeks. + +```javascript +import isoWeeksInYear from 'dayjs/plugin/isoWeeksInYear' +import isLeapYear from 'dayjs/plugin/isLeapYear' // rely on isLeapYear plugin + +dayjs.extend(isoWeeksInYear) +dayjs.extend(isLeapYear) + +dayjs('2004-01-01').isoWeeksInYear() // 53 +dayjs('2005-01-01').isoWeeksInYear() // 52 +``` + ### QuarterOfYear - QuarterOfYear add `.quarter()` API to return to which quarter of the year belongs a date, and extends `.add` `.subtract` `.startOf` `.endOf` APIs to support unit `quarter`. diff --git a/docs/pt-br/API-reference.md b/docs/pt-br/API-reference.md index b3843218b..d14c7958d 100644 --- a/docs/pt-br/API-reference.md +++ b/docs/pt-br/API-reference.md @@ -443,6 +443,12 @@ plugin [`IsLeapYear`](./Plugin.md#isleapyear) plugin [`WeekOfYear`](./Plugin.md#weekofyear) +### IsoWeeksInYear + +`.isoWeeksInYear` to get the number of weeks in year + +plugin [`IsoWeeksInYear`](./Plugin.md#isoweeksinyear) + ### IsSameOrAfter `.isSameOrAfter` to check if a date is same of after another date diff --git a/docs/pt-br/Plugin.md b/docs/pt-br/Plugin.md index 97285b9b5..dfcb55499 100644 --- a/docs/pt-br/Plugin.md +++ b/docs/pt-br/Plugin.md @@ -282,6 +282,21 @@ dayjs('06/27/2018').week() // 26 dayjs('2018-06-27').week(5) // set week ``` +### IsoWeeksInYear + +- IsoWeeksInYear adds `.isoWeeksInYear()` API to return a `number` to get the number of weeks in year, according to ISO weeks. + +```javascript +import isoWeeksInYear from 'dayjs/plugin/isoWeeksInYear' +import isLeapYear from 'dayjs/plugin/isLeapYear' // rely on isLeapYear plugin + +dayjs.extend(isoWeeksInYear) +dayjs.extend(isLeapYear) + +dayjs('2004-01-01').isoWeeksInYear() // 53 +dayjs('2005-01-01').isoWeeksInYear() // 52 +``` + ### QuarterOfYear - QuarterOfYear add `.quarter()` API to return to which quarter of the year belongs a date, and extends `.add` `.subtract` `.startOf` `.endOf` APIs to support unit `quarter`. diff --git a/docs/zh-cn/API-reference.md b/docs/zh-cn/API-reference.md index 2aae96bd5..75c7a3d0a 100644 --- a/docs/zh-cn/API-reference.md +++ b/docs/zh-cn/API-reference.md @@ -496,6 +496,12 @@ dayjs() instanceof dayjs // true 插件 [`WeekOfYear`](./Plugin.md#weekofyear) +### 年中有几周 ISO + +`.isoWeeksInYear` 获得年中有几周 + +plugin [`IsoWeeksInYear`](./Plugin.md#isoweeksinyear) + ### 是否相同或之后 `.isSameOrAfter` 返回一个时间和一个时间相同或在一个时间之后 diff --git a/docs/zh-cn/Plugin.md b/docs/zh-cn/Plugin.md index 5eb76b6e8..49b0a65ab 100644 --- a/docs/zh-cn/Plugin.md +++ b/docs/zh-cn/Plugin.md @@ -281,6 +281,21 @@ dayjs('06/27/2018').week() // 26 dayjs('2018-06-27').week(5) // 设置周 ``` +### IsoWeeksInYear + +- IsoWeeksInYear 增加了 `.isoWeeksInYear()` API 返回一个 `number` 来得到依据 ISO week 标准一年中有几周 + +```javascript +import isoWeeksInYear from 'dayjs/plugin/isoWeeksInYear' +import isLeapYear from 'dayjs/plugin/isLeapYear' // rely on isLeapYear plugin + +dayjs.extend(isoWeeksInYear) +dayjs.extend(isLeapYear) + +dayjs('2004-01-01').isoWeeksInYear() // 53 +dayjs('2005-01-01').isoWeeksInYear() // 52 +``` + ### QuarterOfYear - QuarterOfYear 增加了 `.quarter()` API 返回一个 `number` 来表示 `Dayjs` 的日期是第几个季度,并扩展了 `.add` `.subtract` `.startOf` `.endOf` API 来支持 `quarter` 季度单位。