From 7e040040962cea1019f57ad7c5b67380275efd18 Mon Sep 17 00:00:00 2001
From: Dennis Fridrich <fridrich.dennis@gmail.com>
Date: Tue, 22 Jan 2019 09:58:02 +0100
Subject: [PATCH 01/11] fix():  Add missing czech language locale (#461)

* Add Czech support
---
 src/locale/cs.js | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/locale/cs.js b/src/locale/cs.js
index 66ade81ef..1f4393f41 100644
--- a/src/locale/cs.js
+++ b/src/locale/cs.js
@@ -17,16 +17,16 @@ const locale = {
     future: 'za %s',
     past: 'před %s',
     s: 'několik sekund',
-    m: 'minutu',
+    m: 'minuta',
     mm: '%d minut',
-    h: 'hodinu',
+    h: 'hodina',
     hh: '%d hodin',
     d: 'den',
-    dd: '%d dní',
+    dd: '%d dnů',
     M: 'měsíc',
-    MM: '%d měsícú',
+    MM: '%d měsíců',
     y: 'rok',
-    yy: '%d let'
+    yy: '%d roků'
   }
 }
 

From f6d9a6441a8b5a5815e690914bed4422289e2024 Mon Sep 17 00:00:00 2001
From: iamkun <kunhello@outlook.com>
Date: Sat, 2 Feb 2019 12:14:56 +0800
Subject: [PATCH 02/11] fix: fix it locale error (#458)

* fix: fix it locale error

* fix: fix es locale monthsShort error

* test: fix test

* fix: add missing es-do and es-us locale file
---
 src/locale/{es-es.js => es-do.js} |  7 +++++--
 src/locale/es-us.js               | 30 ++++++++++++++++++++++++++++++
 src/locale/es.js                  |  6 ++++--
 src/locale/it.js                  |  8 +++++---
 test/locale.test.js               | 26 +++++++++++++-------------
 5 files changed, 57 insertions(+), 20 deletions(-)
 rename src/locale/{es-es.js => es-do.js} (66%)
 create mode 100644 src/locale/es-us.js

diff --git a/src/locale/es-es.js b/src/locale/es-do.js
similarity index 66%
rename from src/locale/es-es.js
rename to src/locale/es-do.js
index ee630fdaa..434584ecd 100644
--- a/src/locale/es-es.js
+++ b/src/locale/es-do.js
@@ -1,9 +1,12 @@
 import dayjs from 'dayjs'
 
 const locale = {
-  name: 'es-es',
-  weekdays: 'Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado'.split('_'),
+  name: 'es-do',
+  weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
+  weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
+  weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
   months: 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'),
+  monthsShort: 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
   relativeTime: {
     future: 'en %s',
     past: 'hace %s',
diff --git a/src/locale/es-us.js b/src/locale/es-us.js
new file mode 100644
index 000000000..ba5b74d9a
--- /dev/null
+++ b/src/locale/es-us.js
@@ -0,0 +1,30 @@
+import dayjs from 'dayjs'
+
+const locale = {
+  name: 'es-us',
+  weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
+  weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
+  weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
+  months: 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'),
+  monthsShort: 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
+  relativeTime: {
+    future: 'en %s',
+    past: 'hace %s',
+    s: 'unos segundos',
+    m: 'un minuto',
+    mm: '%d minutos',
+    h: 'una hora',
+    hh: '%d horas',
+    d: 'un día',
+    dd: '%d días',
+    M: 'un mes',
+    MM: '%d meses',
+    y: 'un año',
+    yy: '%d años'
+  },
+  ordinal: n => `${n}º`
+}
+
+dayjs.locale(locale, null, true)
+
+export default locale
diff --git a/src/locale/es.js b/src/locale/es.js
index d62accccd..e39e4b175 100644
--- a/src/locale/es.js
+++ b/src/locale/es.js
@@ -2,9 +2,11 @@ import dayjs from 'dayjs'
 
 const locale = {
   name: 'es',
-  weekdays: 'Domingo_Lunes_Martes_Miércoles_Jueves_Viernes_Sábado'.split('_'),
+  monthsShort: 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'),
+  weekdays: 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'),
+  weekdaysShort: 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'),
+  weekdaysMin: 'do_lu_ma_mi_ju_vi_sá'.split('_'),
   months: 'Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre'.split('_'),
-  monthsShort: 'enero_feb_marzo_abr_mayo_jun_jul_agosto_sept_oct_nov_dic'.split('_'),
   formats: {
     LT: 'H:mm',
     LTS: 'H:mm:ss',
diff --git a/src/locale/it.js b/src/locale/it.js
index acd0b6202..f5cd43c46 100644
--- a/src/locale/it.js
+++ b/src/locale/it.js
@@ -2,9 +2,11 @@ import dayjs from 'dayjs'
 
 const locale = {
   name: 'it',
-  weekdays: 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'),
-  months: 'Gennaio_Febbraio_Marzo_Aprile_Maggio_Giugno_Luglio_Agosto_Settembre_Ottobre_Novembre_Dicembre'.split('_'),
-  monthsShort: 'genn_febbr_mar_apr_magg_giugno_luglio_ag_sett_ott_nov_dic'.split('_'),
+  weekdays: 'domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato'.split('_'),
+  weekdaysShort: 'dom_lun_mar_mer_gio_ven_sab'.split('_'),
+  weekdaysMin: 'do_lu_ma_me_gi_ve_sa'.split('_'),
+  months: 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'),
+  monthsShort: 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'),
   formats: {
     LT: 'HH:mm',
     LTS: 'HH:mm:ss',
diff --git a/test/locale.test.js b/test/locale.test.js
index c1daa8dad..06560b6ba 100644
--- a/test/locale.test.js
+++ b/test/locale.test.js
@@ -15,7 +15,7 @@ const format = 'dddd D, MMMM'
 it('Uses spanish locale through constructor', () => { // not recommend
   expect(dayjs('2018-4-28', { locale: es })
     .format(format))
-    .toBe('Sábado 28, Abril')
+    .toBe('sábado 28, Abril')
 })
 
 it('set locale for one instance only', () => {
@@ -25,7 +25,7 @@ it('set locale for one instance only', () => {
 
   expect(dayjs('2018-4-28')
     .locale(es).format(format))
-    .toBe('Sábado 28, Abril')
+    .toBe('sábado 28, Abril')
 
   expect(dayjs('2018-4-28')
     .format(format))
@@ -38,7 +38,7 @@ it('set global locale', () => {
     .toBe('Saturday 28, April')
   dayjs.locale(es)
   expect(dayjs('2018-4-28').format(format))
-    .toBe('Sábado 28, Abril')
+    .toBe('sábado 28, Abril')
   dayjs.locale('en')
   expect(dayjs('2018-4-28').format(format))
     .toBe('Saturday 28, April')
@@ -50,10 +50,10 @@ it('immutable instance locale', () => {
   expect(origin.format(format))
     .toBe('Saturday 28, April')
   expect(origin.locale('es').format(format))
-    .toBe('Sábado 28, Abril')
+    .toBe('sábado 28, Abril')
   const changed = origin.locale('es')
   expect(changed.format(format))
-    .toBe('Sábado 28, Abril')
+    .toBe('sábado 28, Abril')
   expect(origin.format(format))
     .toBe('Saturday 28, April')
 })
@@ -73,29 +73,29 @@ describe('Instance locale inheritance', () => {
 
   it('Clone', () => {
     expect(esDayjs.clone().format(format))
-      .toBe('Sábado 28, Abril')
+      .toBe('sábado 28, Abril')
     expect(dayjs(esDayjs).format(format))
-      .toBe('Sábado 28, Abril')
+      .toBe('sábado 28, Abril')
   })
 
   it('StartOf EndOf', () => {
     expect(esDayjs.startOf('year').format(format))
-      .toBe('Lunes 1, Enero')
+      .toBe('lunes 1, Enero')
     expect(esDayjs.endOf('day').format(format))
-      .toBe('Sábado 28, Abril')
+      .toBe('sábado 28, Abril')
   })
 
   it('Set', () => {
     expect(esDayjs.set('year', 2017).format(format))
-      .toBe('Viernes 28, Abril')
+      .toBe('viernes 28, Abril')
   })
 
   it('Add', () => {
     expect(esDayjs.add(1, 'year').format(format))
-      .toBe('Domingo 28, Abril')
+      .toBe('domingo 28, Abril')
     expect(esDayjs.add(1, 'month').format(format))
-      .toBe('Lunes 28, Mayo')
+      .toBe('lunes 28, Mayo')
     expect(esDayjs.add(1, 'minute').format(format))
-      .toBe('Sábado 28, Abril')
+      .toBe('sábado 28, Abril')
   })
 })

From 3bd06f2a028da36275d65b1aa6fdf340dbd779b3 Mon Sep 17 00:00:00 2001
From: louis <1891109+dotlouis@users.noreply.github.com>
Date: Sat, 2 Feb 2019 05:18:21 +0100
Subject: [PATCH 03/11] chore: Added shorthand units to UnitType (#470)

---
 index.d.ts | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/index.d.ts b/index.d.ts
index 40f877f5c..de605a8a8 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -7,7 +7,11 @@ declare namespace dayjs {
 
   export type OptionType = { locale: string }
 
-  export type UnitType = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year' | 'date'
+  type UnitTypeShort = 'd' | 'M' | 'y' | 'h' | 'm' | 's' | 'ms'
+  export type UnitType = 'millisecond' | 'second' | 'minute' | 'hour' | 'day' | 'month' | 'quarter' | 'year' | 'date' | UnitTypeShort;
+
+  type OpUnitTypeShort = 'w'
+  export type OpUnitType = UnitType | "week" | OpUnitTypeShort;
 
   interface DayjsObject {
     years: number
@@ -44,17 +48,17 @@ declare namespace dayjs {
 
     set(unit: UnitType, value: number): Dayjs
 
-    add(value: number, unit: UnitType): Dayjs
+    add(value: number, unit: OpUnitType): Dayjs
 
-    subtract(value: number, unit: UnitType): Dayjs
+    subtract(value: number, unit: OpUnitType): Dayjs
 
-    startOf(unit: UnitType): Dayjs
+    startOf(unit: OpUnitType): Dayjs
 
-    endOf(unit: UnitType): Dayjs
+    endOf(unit: OpUnitType): Dayjs
 
     format(template?: string): string
 
-    diff(dayjs: Dayjs, unit: UnitType, float?: boolean): number
+    diff(dayjs: Dayjs, unit: OpUnitType, float?: boolean): number
 
     valueOf(): number
 
@@ -74,11 +78,11 @@ declare namespace dayjs {
 
     toString(): string
 
-    isBefore(dayjs: Dayjs, unit?: UnitType): boolean
+    isBefore(dayjs: Dayjs, unit?: OpUnitType): boolean
 
-    isSame(dayjs: Dayjs, unit?: UnitType): boolean
+    isSame(dayjs: Dayjs, unit?: OpUnitType): boolean
 
-    isAfter(dayjs: Dayjs, unit?: UnitType): boolean
+    isAfter(dayjs: Dayjs, unit?: OpUnitType): boolean
 
     isLeapYear(): boolean
 

From ce2e30e47244e479217dcfd49e7f0c2c73f0e538 Mon Sep 17 00:00:00 2001
From: Arnau Lacambra <naulacambra@gmail.com>
Date: Sat, 2 Feb 2019 07:33:53 +0100
Subject: [PATCH 04/11] fix: add deltaZone in the equation when calculating
 diff and added utcOffset api method (#453)

---
 docs/en/API-reference.md    |  81 ++++++++++++----------
 docs/es-es/API-reference.md | 133 +++++++++++++++++++-----------------
 src/constant.js             |   1 -
 src/index.js                |  12 +++-
 test/display.test.js        |  25 +++++--
 5 files changed, 147 insertions(+), 105 deletions(-)

diff --git a/docs/en/API-reference.md b/docs/en/API-reference.md
index e95153871..6c3ec69a2 100644
--- a/docs/en/API-reference.md
+++ b/docs/en/API-reference.md
@@ -36,6 +36,7 @@ The `Dayjs` object is immutable, that is, all API operations that change the `Da
     - [Difference `.diff(compared: Dayjs, unit: string (default: 'milliseconds'), float?: boolean)`](#difference-diffcompared-dayjs-unit-string-default-milliseconds-float-boolean)
     - [Unix Timestamp (milliseconds) `.valueOf()`](#unix-timestamp-milliseconds-valueof)
     - [Unix Timestamp (seconds) `.unix()`](#unix-timestamp-seconds-unix)
+    - [UTC offset (minutes) `.utcOffset()`](#utc-offset-minutes-utcoffset)
     - [Days in the Month `.daysInMonth()`](#days-in-the-month-daysinmonth)
     - [As Javascript Date `.toDate()`](#as-javascript-date-todate)
     - [As Array `.toArray()`](#as-array-toarray)
@@ -72,7 +73,7 @@ Day.js also parses other date formats.
 #### [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) string
 
 ```js
-dayjs('2018-04-04T16:00:00.000Z');
+dayjs("2018-04-04T16:00:00.000Z");
 ```
 
 #### Native Javascript Date object
@@ -99,7 +100,8 @@ dayjs.unix(1318781876.721);
 ```
 
 ### Custom Parse Format
-* parse custom formats `dayjs("12-25-1995", "MM-DD-YYYY")` in plugin [`CustomParseFormat`](./Plugin.md#customparseformat)
+
+- parse custom formats `dayjs("12-25-1995", "MM-DD-YYYY")` in plugin [`CustomParseFormat`](./Plugin.md#customparseformat)
 
 ### Clone `.clone() | dayjs(original: Dayjs)`
 
@@ -107,7 +109,7 @@ Returns a cloned `Dayjs`.
 
 ```js
 dayjs().clone();
-dayjs(dayjs('2019-01-25')); // passing a Dayjs object to a constructor will also clone it
+dayjs(dayjs("2019-01-25")); // passing a Dayjs object to a constructor will also clone it
 ```
 
 ### Validation `.isValid()`
@@ -189,9 +191,9 @@ dayjs().millisecond();
 Returns a `Dayjs` with the applied changes.
 
 ```js
-dayjs().set('date', 1);
-dayjs().set('month', 3); // April
-dayjs().set('second', 30);
+dayjs().set("date", 1);
+dayjs().set("month", 3); // April
+dayjs().set("second", 30);
 ```
 
 #### List of all available units
@@ -212,9 +214,10 @@ dayjs().set('second', 30);
 `Dayjs` objects can be manipulated in many ways.
 
 ```js
-dayjs('2019-01-25')
-  .add(1, 'day')
-  .subtract(1, 'year').toString(); // Fri, 26 Jan 2018 00:00:00 GMT
+dayjs("2019-01-25")
+  .add(1, "day")
+  .subtract(1, "year")
+  .toString(); // Fri, 26 Jan 2018 00:00:00 GMT
 ```
 
 ### Add `.add(value: number, unit: string)`
@@ -222,7 +225,7 @@ dayjs('2019-01-25')
 Returns a cloned `Dayjs` with a specified amount of time added.
 
 ```js
-dayjs().add(7, 'day');
+dayjs().add(7, "day");
 ```
 
 ### Subtract `.subtract(value: number, unit: string)`
@@ -230,7 +233,7 @@ dayjs().add(7, 'day');
 Returns a cloned `Dayjs` with a specified amount of time subtracted.
 
 ```js
-dayjs().subtract(7, 'year');
+dayjs().subtract(7, "year");
 ```
 
 ### Start of Time `.startOf(unit: string)`
@@ -238,7 +241,7 @@ dayjs().subtract(7, 'year');
 Returns a cloned `Dayjs` set to the start of the specified unit of time.
 
 ```js
-dayjs().startOf('week');
+dayjs().startOf("week");
 ```
 
 ### End of Time `.endOf(unit: string)`
@@ -246,7 +249,7 @@ dayjs().startOf('week');
 Returns a cloned `Dayjs` set to the end of the specified unit of time.
 
 ```js
-dayjs().endOf('month');
+dayjs().endOf("month");
 ```
 
 ## Displaying
@@ -259,9 +262,9 @@ To escape characters, wrap them in square or curly brackets (e.g. `[G] {um}`).
 ```js
 dayjs().format(); // current date in ISO6801, without fraction seconds e.g. '2020-04-02T08:02:17-05:00'
 
-dayjs('2019-01-25').format('{YYYY} MM-DDTHH:mm:ssZ[Z]'); // '{2019} 01-25T00:00:00-02:00Z'
+dayjs("2019-01-25").format("{YYYY} MM-DDTHH:mm:ssZ[Z]"); // '{2019} 01-25T00:00:00-02:00Z'
 
-dayjs('2019-01-25').format('DD/MM/YYYY'); // '25/01/2019'
+dayjs("2019-01-25").format("DD/MM/YYYY"); // '25/01/2019'
 ```
 
 #### List of all available formats
@@ -294,20 +297,20 @@ dayjs('2019-01-25').format('DD/MM/YYYY'); // '25/01/2019'
 | `A`    | AM PM            |                                       |
 | `a`    | am pm            |                                       |
 
-* More available formats `Q Do k kk X x ...` in plugin [`AdvancedFormat`](./Plugin.md#advancedformat)
-* Localized format options `L LT LTS ...` in plugin [`LocalizedFormat`](./Plugin.md#localizedFormat)
+- More available formats `Q Do k kk X x ...` in plugin [`AdvancedFormat`](./Plugin.md#advancedformat)
+- Localized format options `L LT LTS ...` in plugin [`LocalizedFormat`](./Plugin.md#localizedFormat)
 
 ### Difference `.diff(compared: Dayjs, unit: string (default: 'milliseconds'), float?: boolean)`
 
 Returns a `number` indicating the difference of two `Dayjs`s in the specified unit.
 
 ```js
-const date1 = dayjs('2019-01-25');
-const date2 = dayjs('2018-06-05');
+const date1 = dayjs("2019-01-25");
+const date2 = dayjs("2018-06-05");
 date1.diff(date2); // 20214000000
-date1.diff(date2, 'month'); // 7
-date1.diff(date2, 'month', true); // 7.645161290322581
-date1.diff(date2, 'day'); // 233
+date1.diff(date2, "month"); // 7
+date1.diff(date2, "month", true); // 7.645161290322581
+date1.diff(date2, "day"); // 233
 ```
 
 ### Unix Timestamp (milliseconds) `.valueOf()`
@@ -315,7 +318,7 @@ date1.diff(date2, 'day'); // 233
 Returns the `number` of milliseconds since the Unix Epoch for the `Dayjs`.
 
 ```js
-dayjs('2019-01-25').valueOf(); // 1548381600000
+dayjs("2019-01-25").valueOf(); // 1548381600000
 ```
 
 ### Unix Timestamp (seconds) `.unix()`
@@ -323,7 +326,15 @@ dayjs('2019-01-25').valueOf(); // 1548381600000
 Returns the `number` of seconds since the Unix Epoch for the `Dayjs`.
 
 ```js
-dayjs('2019-01-25').unix(); // 1548381600
+dayjs("2019-01-25").unix(); // 1548381600
+```
+
+### UTC Offset (minutes) `.utcOffset()`
+
+Returns the UTC offset in minutes for the `Dayjs`.
+
+```js
+dayjs("2013-03-07T07:00:00+08:00").utcOffset(); // 60
 ```
 
 ### Days in the Month `.daysInMonth()`
@@ -331,7 +342,7 @@ dayjs('2019-01-25').unix(); // 1548381600
 Returns the `number` of days in the `Dayjs`'s month.
 
 ```js
-dayjs('2019-01-25').daysInMonth(); // 31
+dayjs("2019-01-25").daysInMonth(); // 31
 ```
 
 ### As Javascript Date `.toDate()`
@@ -339,7 +350,7 @@ dayjs('2019-01-25').daysInMonth(); // 31
 Returns a copy of the native `Date` object parsed from the `Dayjs` object.
 
 ```js
-dayjs('2019-01-25').toDate();
+dayjs("2019-01-25").toDate();
 ```
 
 ### As Array `.toArray()`
@@ -347,7 +358,7 @@ dayjs('2019-01-25').toDate();
 Returns an `array` that mirrors the parameters from new Date().
 
 ```js
-dayjs('2019-01-25').toArray(); // [ 2019, 0, 25, 0, 0, 0, 0 ]
+dayjs("2019-01-25").toArray(); // [ 2019, 0, 25, 0, 0, 0, 0 ]
 ```
 
 ### As JSON `.toJSON()`
@@ -355,7 +366,7 @@ dayjs('2019-01-25').toArray(); // [ 2019, 0, 25, 0, 0, 0, 0 ]
 Returns the `Dayjs` formatted in an ISO8601 `string`.
 
 ```js
-dayjs('2019-01-25').toJSON(); // '2019-01-25T02:00:00.000Z'
+dayjs("2019-01-25").toJSON(); // '2019-01-25T02:00:00.000Z'
 ```
 
 ### As ISO 8601 String `.toISOString()`
@@ -363,7 +374,7 @@ dayjs('2019-01-25').toJSON(); // '2019-01-25T02:00:00.000Z'
 Returns the `Dayjs` formatted in an ISO8601 `string`.
 
 ```js
-dayjs('2019-01-25').toISOString(); // '2019-01-25T02:00:00.000Z'
+dayjs("2019-01-25").toISOString(); // '2019-01-25T02:00:00.000Z'
 ```
 
 ### As Object `.toObject()`
@@ -371,7 +382,7 @@ dayjs('2019-01-25').toISOString(); // '2019-01-25T02:00:00.000Z'
 Returns an `object` with the date's properties.
 
 ```js
-dayjs('2019-01-25').toObject();
+dayjs("2019-01-25").toObject();
 /* { years: 2019,
      months: 0,
      date: 25,
@@ -386,7 +397,7 @@ dayjs('2019-01-25').toObject();
 Returns a `string` representation of the date.
 
 ```js
-dayjs('2019-01-25').toString(); // 'Fri, 25 Jan 2019 02:00:00 GMT'
+dayjs("2019-01-25").toString(); // 'Fri, 25 Jan 2019 02:00:00 GMT'
 ```
 
 ## Query
@@ -397,7 +408,7 @@ Returns a `boolean` indicating whether the `Dayjs`'s date is before the other su
 
 ```js
 dayjs().isBefore(dayjs()); // false
-dayjs().isBefore(dayjs(), 'year'); // false
+dayjs().isBefore(dayjs(), "year"); // false
 ```
 
 ### Is Same `.isSame(compared: Dayjs, unit?: string)`
@@ -406,7 +417,7 @@ Returns a `boolean` indicating whether the `Dayjs`'s date is the same as the oth
 
 ```js
 dayjs().isSame(dayjs()); // true
-dayjs().isSame(dayjs(), 'year'); // true
+dayjs().isSame(dayjs(), "year"); // true
 ```
 
 ### Is After `.isAfter(compared: Dayjs, unit?: string)`
@@ -415,7 +426,7 @@ Returns a `boolean` indicating whether the `Dayjs`'s date is after the other sup
 
 ```js
 dayjs().isAfter(dayjs()); // false
-dayjs().isAfter(dayjs(), 'year'); // false
+dayjs().isAfter(dayjs(), "year"); // false
 ```
 
 ### Is a Dayjs `.isDayjs(compared: any)`
@@ -430,7 +441,7 @@ dayjs.isDayjs(new Date()); // false
 The operator `instanceof` works equally well:
 
 ```js
-dayjs() instanceof dayjs // true
+dayjs() instanceof dayjs; // true
 ```
 
 ## Plugin APIs
diff --git a/docs/es-es/API-reference.md b/docs/es-es/API-reference.md
index ce70ac1e2..2aeb9ffad 100644
--- a/docs/es-es/API-reference.md
+++ b/docs/es-es/API-reference.md
@@ -36,6 +36,7 @@ El objeto `Dayjs` es inmutable, por lo que toda operación de la API que altere
     - [Diferencia `.diff(compared: Dayjs, unit: string (predeterminada: 'milliseconds'), float?: boolean)`](#diferencia-diffcompared-dayjs-unit-string-predeterminada-milliseconds-float-boolean)
     - [Tiempo Unix (milisegundos) `.valueOf()`](#tiempo-unix-milisegundos-valueof)
     - [Tiempo Unix (segundos) `.unix()`](#tiempo-unix-segundos-unix)
+    - [UTC offset (minutos) `.utcOffset()`](#utc-offset-minutos-utcoffset)
     - [Días en el mes `.daysInMonth()`](#días-en-el-mes-daysinmonth)
     - [Como objeto `Date` `.toDate()`](#como-objeto-date-todate)
     - [Como array `.toArray()`](#como-array-toarray)
@@ -72,7 +73,7 @@ Day.js también analiza otros formatos de fecha.
 #### Cadena [ISO 8601](https://es.wikipedia.org/wiki/ISO_8601)
 
 ```js
-dayjs('2018-04-04T16:00:00.000Z');
+dayjs("2018-04-04T16:00:00.000Z");
 ```
 
 #### Objeto `Date` nativo
@@ -99,7 +100,8 @@ dayjs.unix(1318781876.721);
 ```
 
 ### Custom Parse Format
-* parse custom formats `dayjs("12-25-1995", "MM-DD-YYYY")` in plugin [`CustomParseFormat`](./Plugin.md#customparseformat)
+
+- parse custom formats `dayjs("12-25-1995", "MM-DD-YYYY")` in plugin [`CustomParseFormat`](./Plugin.md#customparseformat)
 
 ### Clonar `.clone() | dayjs(original: Dayjs)`
 
@@ -107,7 +109,7 @@ Devuelve una copia de `Dayjs`.
 
 ```js
 dayjs().clone();
-dayjs(dayjs('2019-01-25')); // si el constructor recibe un objeto Dayjs también lo clonará
+dayjs(dayjs("2019-01-25")); // si el constructor recibe un objeto Dayjs también lo clonará
 ```
 
 ### Validación `.isValid()`
@@ -189,15 +191,15 @@ dayjs().millisecond();
 Devuelve un nuevo objeto `Dayjs` con los cambios aplicados.
 
 ```js
-dayjs().set('date', 1);
-dayjs().set('month', 3); // Abril
-dayjs().set('second', 30);
+dayjs().set("date", 1);
+dayjs().set("month", 3); // Abril
+dayjs().set("second", 30);
 ```
 
 #### Lista de unidades disponibles
 
 | Unit          | Abreviatura | Descripción                                 |
-| ------------- | ----------- | ------------------------------------------  |
+| ------------- | ----------- | ------------------------------------------- |
 | `date`        |             | Día del mes                                 |
 | `day`         | `d`         | Día de la semana (de domingo 0, a sábado 6) |
 | `month`       | `M`         | Mes                                         |
@@ -212,9 +214,10 @@ dayjs().set('second', 30);
 Los objetos `Dayjs` pueden manipularse de diversas formas.
 
 ```js
-dayjs('2019-01-25')
-  .add(1, 'day')
-  .subtract(1, 'year').toString(); // Fri, 26 Jan 2018 00:00:00 GMT
+dayjs("2019-01-25")
+  .add(1, "day")
+  .subtract(1, "year")
+  .toString(); // Fri, 26 Jan 2018 00:00:00 GMT
 ```
 
 ### Añadir `.add(value: number, unit: string)`
@@ -222,7 +225,7 @@ dayjs('2019-01-25')
 Devuelve un nuevo objeto `Dayjs`, resultante de añadir al actual el tiempo indicado.
 
 ```js
-dayjs().add(7, 'day');
+dayjs().add(7, "day");
 ```
 
 ### Restar `.subtract(value: number, unit: string)`
@@ -230,7 +233,7 @@ dayjs().add(7, 'day');
 Devuelve un nuevo objeto `Dayjs`, resultante de restar al actual el tiempo indicado.
 
 ```js
-dayjs().subtract(7, 'year');
+dayjs().subtract(7, "year");
 ```
 
 ### Principio de `.startOf(unit: string)`
@@ -238,7 +241,7 @@ dayjs().subtract(7, 'year');
 Devuelve un nuevo objeto `Dayjs`, resultante de ajustar el actual al principio de la unidad de tiempo indicada.
 
 ```js
-dayjs().startOf('week');
+dayjs().startOf("week");
 ```
 
 ### Fin de `.endOf(unit: string)`
@@ -246,7 +249,7 @@ dayjs().startOf('week');
 Devuelve un nuevo objeto `Dayjs`, resultante de ajustar el actual al final de la unidad de tiempo indicada.
 
 ```js
-dayjs().endOf('month');
+dayjs().endOf("month");
 ```
 
 ## Presentación
@@ -259,40 +262,40 @@ Para escapar caracteres, estos se han de encerrar entre corchetes o llaves (p.ej
 ```js
 dayjs().format(); // fecha actual en ISO6801, sin fracciones de segundo p.ej. '2020-04-02T08:02:17-05:00'
 
-dayjs('2019-01-25').format('{YYYY} MM-DDTHH:mm:ssZ[Z]'); // '{2019} 01-25T00:00:00-02:00Z'
+dayjs("2019-01-25").format("{YYYY} MM-DDTHH:mm:ssZ[Z]"); // '{2019} 01-25T00:00:00-02:00Z'
 
-dayjs('2019-01-25').format('DD/MM/YYYY'); // '25/01/2019'
+dayjs("2019-01-25").format("DD/MM/YYYY"); // '25/01/2019'
 ```
 
 #### Lista de formatos disponibles
 
-| Formato | Salida           | Descripción                               |
-| ------- | ---------------- | ----------------------------------------- |
-| `YY`    | 18               | Año, con 2 dígitos                        |
-| `YYYY`  | 2018             | Año, con 4 dígitos                        |
-| `M`     | 1-12             | Mes, contando desde 1                     |
-| `MM`    | 01-12            | Mes, con 2 dígitos                        |
-| `MMM`   | Jan-Dec          | Nombre abreviado del mes                  |
-| `MMMM`  | January-December | Nombre completo del mes                   |
-| `D`     | 1-31             | Día del mes                               |
-| `DD`    | 01-31            | Día del mes, con 2 dígitos                |
-| `d`     | 0-6              | Día de la semana, siendo el domingo el 0  |
-| `dd`    | Su-Sa            | Nombre mínimo del día de la semana        |
-| `ddd`   | Sun-Sat          | Nombre abreviado del día de la semana     |
-| `dddd`  | Sunday-Saturday  | Nombre del día de la semana               |
-| `H`     | 0-23             | Hora                                      |
-| `HH`    | 00-23            | Hora, con 2 dígitos                       |
-| `h`     | 1-12             | Hora, formato de 12 horas                 |
-| `hh`    | 01-12            | Hora, formato de 12 horas, con 2 dígitos  |
-| `m`     | 0-59             | Minutos                                   |
-| `mm`    | 00-59            | Minutos, con 2 dígitos                    |
-| `s`     | 0-59             | Segundos                                  |
-| `ss`    | 00-59            | Segundos, con 2 dígitos                   |
-| `SSS`   | 000-999          | Milisegundos, con 3 dígitos               |
-| `Z`     | +5:00            | Diferencia horaria UTC                    |
-| `ZZ`    | +0500            | Diferencia horaria UTC, con 2 dígitos     |
-| `A`     | AM PM            |                                           |
-| `a`     | am pm            |                                           |
+| Formato | Salida           | Descripción                              |
+| ------- | ---------------- | ---------------------------------------- |
+| `YY`    | 18               | Año, con 2 dígitos                       |
+| `YYYY`  | 2018             | Año, con 4 dígitos                       |
+| `M`     | 1-12             | Mes, contando desde 1                    |
+| `MM`    | 01-12            | Mes, con 2 dígitos                       |
+| `MMM`   | Jan-Dec          | Nombre abreviado del mes                 |
+| `MMMM`  | January-December | Nombre completo del mes                  |
+| `D`     | 1-31             | Día del mes                              |
+| `DD`    | 01-31            | Día del mes, con 2 dígitos               |
+| `d`     | 0-6              | Día de la semana, siendo el domingo el 0 |
+| `dd`    | Su-Sa            | Nombre mínimo del día de la semana       |
+| `ddd`   | Sun-Sat          | Nombre abreviado del día de la semana    |
+| `dddd`  | Sunday-Saturday  | Nombre del día de la semana              |
+| `H`     | 0-23             | Hora                                     |
+| `HH`    | 00-23            | Hora, con 2 dígitos                      |
+| `h`     | 1-12             | Hora, formato de 12 horas                |
+| `hh`    | 01-12            | Hora, formato de 12 horas, con 2 dígitos |
+| `m`     | 0-59             | Minutos                                  |
+| `mm`    | 00-59            | Minutos, con 2 dígitos                   |
+| `s`     | 0-59             | Segundos                                 |
+| `ss`    | 00-59            | Segundos, con 2 dígitos                  |
+| `SSS`   | 000-999          | Milisegundos, con 3 dígitos              |
+| `Z`     | +5:00            | Diferencia horaria UTC                   |
+| `ZZ`    | +0500            | Diferencia horaria UTC, con 2 dígitos    |
+| `A`     | AM PM            |                                          |
+| `a`     | am pm            |                                          |
 
 \* Más formatos disponibles `Q Do k kk X x ...` con el complemento [`AdvancedFormat`](./Plugin.md#advancedformat)
 
@@ -301,12 +304,12 @@ dayjs('2019-01-25').format('DD/MM/YYYY'); // '25/01/2019'
 Devuelve un dato de tipo `number`, que indica la diferencia existente entre dos objetos `Dayjs`, expresada en la unidad de tiempo dada.
 
 ```js
-const date1 = dayjs('2019-01-25');
-const date2 = dayjs('2018-06-05');
+const date1 = dayjs("2019-01-25");
+const date2 = dayjs("2018-06-05");
 date1.diff(date2); // 20214000000
-date1.diff(date2, 'month'); // 7
-date1.diff(date2, 'month', true); // 7.645161290322581
-date1.diff(date2, 'day'); // 233
+date1.diff(date2, "month"); // 7
+date1.diff(date2, "month", true); // 7.645161290322581
+date1.diff(date2, "day"); // 233
 ```
 
 ### Tiempo Unix (milisegundos) `.valueOf()`
@@ -314,7 +317,7 @@ date1.diff(date2, 'day'); // 233
 Devuelve un dato de tipo `number`, que indica el número de milisegundos transcurridos desde la época Unix para el objeto `Dayjs`.
 
 ```js
-dayjs('2019-01-25').valueOf(); // 1548381600000
+dayjs("2019-01-25").valueOf(); // 1548381600000
 ```
 
 ### Tiempo Unix (segundos) `.unix()`
@@ -322,7 +325,15 @@ dayjs('2019-01-25').valueOf(); // 1548381600000
 Devuelve un dato de tipo `number`, que indica el número de segundos transcurridos desde la época Unix para el objeto `Dayjs`.
 
 ```js
-dayjs('2019-01-25').unix(); // 1548381600
+dayjs("2019-01-25").unix(); // 1548381600
+```
+
+### UTC Offset (minutos) `.utcOffset()`
+
+Devuelve el UTC offset en minutos del `Dayjs`.
+
+```js
+dayjs("2013-03-07T07:00:00+08:00").utcOffset(); // 60
 ```
 
 ### Días en el mes `.daysInMonth()`
@@ -330,7 +341,7 @@ dayjs('2019-01-25').unix(); // 1548381600
 Devuelve un dato de tipo `number`, que indica el número de días contenidos en el mes del objeto `Dayjs`.
 
 ```js
-dayjs('2019-01-25').daysInMonth(); // 31
+dayjs("2019-01-25").daysInMonth(); // 31
 ```
 
 ### Como objeto `Date` `.toDate()`
@@ -338,7 +349,7 @@ dayjs('2019-01-25').daysInMonth(); // 31
 Devuelve un objeto `Date` nativo, obtenido a partir del objeto `Dayjs`.
 
 ```js
-dayjs('2019-01-25').toDate();
+dayjs("2019-01-25").toDate();
 ```
 
 ### Como array `.toArray()`
@@ -346,7 +357,7 @@ dayjs('2019-01-25').toDate();
 Devuelve un array que reproduce los parámetros de `new Date()`.
 
 ```js
-dayjs('2019-01-25').toArray(); // [ 2019, 0, 25, 0, 0, 0, 0 ]
+dayjs("2019-01-25").toArray(); // [ 2019, 0, 25, 0, 0, 0, 0 ]
 ```
 
 ### Como JSON `.toJSON()`
@@ -354,7 +365,7 @@ dayjs('2019-01-25').toArray(); // [ 2019, 0, 25, 0, 0, 0, 0 ]
 Devuelve un objeto `Dayjs` formateado como una cadena ISO8601.
 
 ```js
-dayjs('2019-01-25').toJSON(); // '2019-01-25T02:00:00.000Z'
+dayjs("2019-01-25").toJSON(); // '2019-01-25T02:00:00.000Z'
 ```
 
 ### Como cadena ISO 8601 `.toISOString()`
@@ -362,7 +373,7 @@ dayjs('2019-01-25').toJSON(); // '2019-01-25T02:00:00.000Z'
 Devuelve un objeto `Dayjs` formateado como una cadena ISO8601.
 
 ```js
-dayjs('2019-01-25').toISOString(); // '2019-01-25T02:00:00.000Z'
+dayjs("2019-01-25").toISOString(); // '2019-01-25T02:00:00.000Z'
 ```
 
 ### Como objecto `.toObject()`
@@ -370,7 +381,7 @@ dayjs('2019-01-25').toISOString(); // '2019-01-25T02:00:00.000Z'
 Devuelve un dato de tipo `object`, con las propiedades de la fecha.
 
 ```js
-dayjs('2019-01-25').toObject();
+dayjs("2019-01-25").toObject();
 /* { years: 2019,
      months: 0,
      date: 25,
@@ -385,7 +396,7 @@ dayjs('2019-01-25').toObject();
 Devuelve un dato de tipo `string`, que representa la fecha.
 
 ```js
-dayjs('2019-01-25').toString(); // 'Fri, 25 Jan 2019 02:00:00 GMT'
+dayjs("2019-01-25").toString(); // 'Fri, 25 Jan 2019 02:00:00 GMT'
 ```
 
 ## Consulta
@@ -396,7 +407,7 @@ Devuelve un dato de tipo `boolean`, que indica si la fecha del objeto `Dayjs` in
 
 ```js
 dayjs().isBefore(dayjs()); // false
-dayjs().isBefore(dayjs(), 'year'); // false
+dayjs().isBefore(dayjs(), "year"); // false
 ```
 
 ### Igual que `.isSame(compared: Dayjs, unit?: string)`
@@ -405,7 +416,7 @@ Devuelve un dato de tipo `boolean`, que indica si la fecha del objeto `Dayjs` in
 
 ```js
 dayjs().isSame(dayjs()); // true
-dayjs().isSame(dayjs(), 'year'); // true
+dayjs().isSame(dayjs(), "year"); // true
 ```
 
 ### Posterior a `.isAfter(compared: Dayjs, unit?: string)`
@@ -414,7 +425,7 @@ Devuelve un dato de tipo `boolean`, que indica si la fecha del objeto `Dayjs` in
 
 ```js
 dayjs().isAfter(dayjs()); // false
-dayjs().isAfter(dayjs(), 'year'); // false
+dayjs().isAfter(dayjs(), "year"); // false
 ```
 
 ### Es Dayjs `.isDayjs(compared: any)`
@@ -429,7 +440,7 @@ dayjs.isDayjs(new Date()); // false
 The operator `instanceof` works equally well:
 
 ```js
-dayjs() instanceof dayjs // true
+dayjs() instanceof dayjs; // true
 ```
 
 ## API de complementos
diff --git a/src/constant.js b/src/constant.js
index 57d1dcfcf..dc0af79b0 100644
--- a/src/constant.js
+++ b/src/constant.js
@@ -34,4 +34,3 @@ export const en = {
   weekdays: 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'),
   months: 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_')
 }
-
diff --git a/src/index.js b/src/index.js
index 67f1612ea..1548bc507 100644
--- a/src/index.js
+++ b/src/index.js
@@ -212,7 +212,6 @@ class Dayjs {
     return this
   }
 
-
   set(string, int) {
     return this.clone().$set(string, int)
   }
@@ -303,9 +302,16 @@ class Dayjs {
     })
   }
 
+  utcOffset() {
+    // Because a bug at FF24, we're rounding the timezone offset around 15 minutes
+    // https://github.com/moment/moment/pull/1871
+    return -Math.round(this.$d.getTimezoneOffset() / 15) * 15
+  }
+
   diff(input, units, float) {
     const unit = Utils.prettyUnit(units)
     const that = dayjs(input)
+    const zoneDelta = (that.utcOffset() - this.utcOffset()) * C.MILLISECONDS_A_MINUTE
     const diff = this - that
     let result = Utils.monthDiff(this, that)
 
@@ -313,8 +319,8 @@ class Dayjs {
       [C.Y]: result / 12,
       [C.M]: result,
       [C.Q]: result / 3,
-      [C.W]: diff / C.MILLISECONDS_A_WEEK,
-      [C.D]: diff / C.MILLISECONDS_A_DAY,
+      [C.W]: (diff - zoneDelta) / C.MILLISECONDS_A_WEEK,
+      [C.D]: (diff - zoneDelta) / C.MILLISECONDS_A_DAY,
       [C.H]: diff / C.MILLISECONDS_A_HOUR,
       [C.MIN]: diff / C.MILLISECONDS_A_MINUTE,
       [C.S]: diff / C.MILLISECONDS_A_SECOND
diff --git a/test/display.test.js b/test/display.test.js
index 076d5b127..487f47e6a 100644
--- a/test/display.test.js
+++ b/test/display.test.js
@@ -86,7 +86,6 @@ it('Format Second s ss SSS', () => {
   expect(dayjs(date).format('s-ss-SSS')).toBe(moment(date).format('s-ss-SSS'))
 })
 
-
 it('Format Time Zone ZZ', () => {
   MockDate.set(new Date('2018-05-02T23:00:00.000'), 60 * 8)
   expect(dayjs().format('Z')).toBe(moment().format('Z'))
@@ -104,9 +103,21 @@ it('Format Time Zone ZZ', () => {
 })
 
 it('Format ddd dd MMM with short locale', () => {
-  expect(dayjs().locale(th).format('dd')).toBe(moment().locale('th').format('dd'))
-  expect(dayjs().locale(th).format('ddd')).toBe(moment().locale('th').format('ddd'))
-  expect(dayjs().locale(th).format('MMM')).toBe(moment().locale('th').format('MMM'))
+  expect(dayjs()
+    .locale(th)
+    .format('dd')).toBe(moment()
+    .locale('th')
+    .format('dd'))
+  expect(dayjs()
+    .locale(th)
+    .format('ddd')).toBe(moment()
+    .locale('th')
+    .format('ddd'))
+  expect(dayjs()
+    .locale(th)
+    .format('MMM')).toBe(moment()
+    .locale('th')
+    .format('MMM'))
 })
 
 it('Format Complex with other string - : / ', () => {
@@ -170,7 +181,6 @@ describe('Difference', () => {
     })
   })
 
-
   it('MonthDiff', () => {
     expect(dayjs('2018-08-08').diff(dayjs('2018-08-08'), 'month')).toEqual(0)
     expect(dayjs('2018-09-08').diff(dayjs('2018-08-08'), 'month')).toEqual(1)
@@ -192,6 +202,11 @@ it('Days in Month', () => {
   expect(dayjs('20140201').daysInMonth()).toBe(moment('20140201').daysInMonth())
 })
 
+it('Utc Offset', () => {
+  expect(dayjs('2013-01-01T00:00:00.000').utcOffset()).toBe(moment('2013-01-01T00:00:00.000').utcOffset())
+  expect(dayjs('2013-01-01T05:00:00.000').utcOffset()).toBe(moment('2013-01-01T05:00:00.000').utcOffset())
+})
+
 it('As Javascript Date -> toDate', () => {
   const base = dayjs()
   const momentBase = moment()

From 50cf0007ea983ef7bb5308709febaff183a0e302 Mon Sep 17 00:00:00 2001
From: iamkun <kunhello@outlook.com>
Date: Sat, 2 Feb 2019 14:47:27 +0800
Subject: [PATCH 05/11] test: update test timezone

---
 .travis.yml                            | 1 -
 package.json                           | 5 ++---
 test/{dst.test.js => timezone.test.js} | 0
 3 files changed, 2 insertions(+), 4 deletions(-)
 rename test/{dst.test.js => timezone.test.js} (100%)

diff --git a/.travis.yml b/.travis.yml
index ae7bdfed6..51231394a 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -12,7 +12,6 @@ install:
   - npm install
 script:
   - npm run lint
-  - npm run test-dst
   - npm test
   - codecov
 after_success:
diff --git a/package.json b/package.json
index 05a9cf2cd..4ae0104d4 100644
--- a/package.json
+++ b/package.json
@@ -6,9 +6,8 @@
   "types": "index.d.ts",
   "module": "./src/index.js",
   "scripts": {
-    "test": "jest",
-    "test-dst": "TZ=Pacific/Auckland npm run dst-test && TZ=Europe/London npm run dst-test && npm run dst-test",
-    "dst-test": "jest test/dst.test --coverage=false",
+    "test": "jest && TZ=Pacific/Auckland npm run test-tz && TZ=Europe/London npm run test-tz && npm run test-tz",
+    "test-tz": "jest test/timezone.test --coverage=false",
     "lint": "./node_modules/.bin/eslint src/* test/* build/*",
     "build": "cross-env BABEL_ENV=build node build && npm run size",
     "sauce": "npx karma start karma.sauce.conf.js",
diff --git a/test/dst.test.js b/test/timezone.test.js
similarity index 100%
rename from test/dst.test.js
rename to test/timezone.test.js

From f535b95cbfd2729c9775b6f79c88a5de2566cab4 Mon Sep 17 00:00:00 2001
From: iamkun <kunhello@outlook.com>
Date: Sat, 2 Feb 2019 14:54:36 +0800
Subject: [PATCH 06/11] test: update diff dst test

---
 test/timezone.test.js | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/test/timezone.test.js b/test/timezone.test.js
index 997a8be98..59410ad43 100644
--- a/test/timezone.test.js
+++ b/test/timezone.test.js
@@ -19,3 +19,20 @@ it('Add Time days (DST)', () => {
   expect(dayjs('2018-10-28').add(1, 'd').format()).toBe(moment('2018-10-28').add(1, 'd').format())
   expect(dayjs('2018-10-26').add(1, 'w').format()).toBe(moment('2018-10-26').add(1, 'w').format())
 })
+
+it('Utc Offset', () => {
+  expect(dayjs().utcOffset()).toBe(moment().utcOffset())
+})
+
+it('Diff (DST)', () => {
+  const day = '2018-10-28'
+  const dayjsA = dayjs(day)
+  const dayjsB = dayjs(day).add(-1000, 'days')
+  const momentA = moment(day)
+  const momentB = moment(day).add(-1000, 'days')
+  const units = ['seconds', 'minutes', 'hours', 'days', 'weeks', 'months', 'quarters', 'years']
+  units.forEach((unit) => {
+    expect(dayjsA.diff(dayjsB, unit)).toBe(momentA.diff(momentB, unit))
+    expect(dayjsA.diff(dayjsB, unit, true)).toBe(momentA.diff(momentB, unit, true))
+  })
+})

From a14e804d3b12d3c3aa18166aeccb61a103e362d8 Mon Sep 17 00:00:00 2001
From: Arnau Lacambra <naulacambra@gmail.com>
Date: Sat, 2 Feb 2019 08:15:46 +0100
Subject: [PATCH 07/11] chore: Created dayOfYear plugin (#454)

---
 docs/en/Plugin.md             | 246 +++++++++++++++++++---------------
 docs/es-es/Plugin.md          | 234 ++++++++++++++++----------------
 src/plugin/dayOfYear/index.js |   7 +
 test/plugin/dayOfYear.test.js |  47 +++++++
 4 files changed, 308 insertions(+), 226 deletions(-)
 create mode 100644 src/plugin/dayOfYear/index.js
 create mode 100644 test/plugin/dayOfYear.test.js

diff --git a/docs/en/Plugin.md b/docs/en/Plugin.md
index ec35369e5..692e2e9aa 100644
--- a/docs/en/Plugin.md
+++ b/docs/en/Plugin.md
@@ -10,7 +10,7 @@ You can load multiple plugins based on your need.
 
 #### Extend
 
-* Returns dayjs
+- Returns dayjs
 
 Use a plugin.
 
@@ -22,16 +22,17 @@ dayjs.extend(plugin, options) // with plugin options
 
 ## Installation
 
-* Via NPM:
+- Via NPM:
 
 ```javascript
-import dayjs from 'dayjs'
-import AdvancedFormat from 'dayjs/plugin/advancedFormat' // load on demand
+import dayjs from "dayjs";
+import AdvancedFormat from "dayjs/plugin/advancedFormat"; // load on demand
 
-dayjs.extend(AdvancedFormat) // use plugin
+dayjs.extend(AdvancedFormat); // use plugin
 ```
 
-* Via CDN:
+- Via CDN:
+
 ```html
 <script src="https://unpkg.com/dayjs"></script>
 <!-- Load plugin as window.dayjs_plugin_NAME -->
@@ -44,26 +45,27 @@ dayjs.extend(AdvancedFormat) // use plugin
 ## List of official plugins
 
 ### AdvancedFormat
- - AdvancedFormat extends `dayjs().format` API to supply more format options.
+
+- AdvancedFormat extends `dayjs().format` API to supply more format options.
 
 ```javascript
-import advancedFormat from 'dayjs/plugin/advancedFormat'
+import advancedFormat from "dayjs/plugin/advancedFormat";
 
-dayjs.extend(advancedFormat)
+dayjs.extend(advancedFormat);
 
-dayjs().format('Q Do k kk X x')
+dayjs().format("Q Do k kk X x");
 ```
 
 List of added formats:
 
-| Format | Output           | Description                           |
-| ------ | ---------------- | ------------------------------------- |
-| `Q`    | 1-4              | Quarter                               |
-| `Do`   | 1st 2nd ... 31st | Day of Month with ordinal             |
-| `k`    | 1-23             | The hour, beginning at 1              |
-| `kk`   | 01-23            | The hour, 2-digits, beginning at 1    |
-| `X`    | 1360013296       | Unix Timestamp in second              |
-| `x`    | 1360013296123    | Unix Timestamp in millisecond         |
+| Format | Output           | Description                        |
+| ------ | ---------------- | ---------------------------------- |
+| `Q`    | 1-4              | Quarter                            |
+| `Do`   | 1st 2nd ... 31st | Day of Month with ordinal          |
+| `k`    | 1-23             | The hour, beginning at 1           |
+| `kk`   | 01-23            | The hour, 2-digits, beginning at 1 |
+| `X`    | 1360013296       | Unix Timestamp in second           |
+| `x`    | 1360013296123    | Unix Timestamp in millisecond      |
 
 ### LocalizedFormat
  - LocalizedFormat extends `dayjs().format` API to supply localized format options known from Moment.js.
@@ -88,28 +90,29 @@ List of added formats:
 | `LLLL` | dddd, MMMM D, YYYY h:mm A | Thursday, August 16, 2018 8:02 PM |
 
 ### RelativeTime
- - RelativeTime adds `.from` `.to` `.fromNow` `.toNow` APIs to formats date to relative time strings (e.g. 3 hours ago).
+
+- RelativeTime adds `.from` `.to` `.fromNow` `.toNow` APIs to formats date to relative time strings (e.g. 3 hours ago).
 
 ```javascript
-import relativeTime from 'dayjs/plugin/relativeTime'
+import relativeTime from "dayjs/plugin/relativeTime";
 
-dayjs.extend(relativeTime)
+dayjs.extend(relativeTime);
 
-dayjs().from(dayjs('1990')) // 2 years ago
-dayjs().from(dayjs(), true) // 2 years
+dayjs().from(dayjs("1990")); // 2 years ago
+dayjs().from(dayjs(), true); // 2 years
 
-dayjs().fromNow()
+dayjs().fromNow();
 
-dayjs().to(dayjs())
+dayjs().to(dayjs());
 
-dayjs().toNow()
+dayjs().toNow();
 ```
 
 #### Time from now `.fromNow(withoutSuffix?: boolean)`
 
 Returns the `string` of relative time from now.
 
-#### Time from X  `.from(compared: Dayjs, withoutSuffix?: boolean)`
+#### Time from X `.from(compared: Dayjs, withoutSuffix?: boolean)`
 
 Returns the `string` of relative time from X.
 
@@ -117,149 +120,169 @@ Returns the `string` of relative time from X.
 
 Returns the `string` of relative time to now.
 
-#### Time to X  `.to(compared: Dayjs, withoutSuffix?: boolean)`
+#### Time to X `.to(compared: Dayjs, withoutSuffix?: boolean)`
 
 Returns the `string` of relative time to X.
 
-| Range                    | Key  | Sample Output                    |
-| ------------------------ | ---- | -------------------------------- |
-| 0 to 44 seconds          | s    | a few seconds ago                |
-| 45 to 89 seconds         | m    | a minute ago                     |
-| 90 seconds to 44 minutes | mm   | 2 minutes ago ... 44 minutes ago |
-| 45 to 89 minutes         | h    | an hour ago                      |
-| 90 minutes to 21 hours   | hh   | 2 hours ago ... 21 hours ago     |
-| 22 to 35 hours           | d    | a day ago                        |
-| 36 hours to 25 days      | dd   | 2 days ago ... 25 days ago       |
-| 26 to 45 days            | M    | a month ago                      |
-| 46 days to 10 months     | MM   | 2 months ago ... 10 months ago   |
-| 11 months to 17months    | y    | a year ago                       |
-| 18 months+               | yy   | 2 years ago ... 20 years ago     |
+| Range                    | Key | Sample Output                    |
+| ------------------------ | --- | -------------------------------- |
+| 0 to 44 seconds          | s   | a few seconds ago                |
+| 45 to 89 seconds         | m   | a minute ago                     |
+| 90 seconds to 44 minutes | mm  | 2 minutes ago ... 44 minutes ago |
+| 45 to 89 minutes         | h   | an hour ago                      |
+| 90 minutes to 21 hours   | hh  | 2 hours ago ... 21 hours ago     |
+| 22 to 35 hours           | d   | a day ago                        |
+| 36 hours to 25 days      | dd  | 2 days ago ... 25 days ago       |
+| 26 to 45 days            | M   | a month ago                      |
+| 46 days to 10 months     | MM  | 2 months ago ... 10 months ago   |
+| 11 months to 17months    | y   | a year ago                       |
+| 18 months+               | yy  | 2 years ago ... 20 years ago     |
 
 ### IsLeapYear
- - IsLeapYear adds `.isLeapYear` API to returns a `boolean` indicating whether the `Dayjs`'s year is a leap year or not.
+
+- IsLeapYear adds `.isLeapYear` API to returns a `boolean` indicating whether the `Dayjs`'s year is a leap year or not.
 
 ```javascript
-import isLeapYear from 'dayjs/plugin/isLeapYear'
+import isLeapYear from "dayjs/plugin/isLeapYear";
 
-dayjs.extend(isLeapYear)
+dayjs.extend(isLeapYear);
 
-dayjs('2000-01-01').isLeapYear(); // true
+dayjs("2000-01-01").isLeapYear(); // true
 ```
 
 ### BuddhistEra
+
 - BuddhistEra extends `dayjs().format` API to supply Buddhist Era (B.E.) format options.
-- Buddhist Era is a year numbering system that primarily used in  mainland Southeast Asian countries of Cambodia, Laos, Myanmar and Thailand as well as in Sri Lanka and Chinese populations of Malaysia and Singapore for religious or official occasions ([Wikipedia](https://en.wikipedia.org/wiki/Buddhist_calendar))
+- Buddhist Era is a year numbering system that primarily used in mainland Southeast Asian countries of Cambodia, Laos, Myanmar and Thailand as well as in Sri Lanka and Chinese populations of Malaysia and Singapore for religious or official occasions ([Wikipedia](https://en.wikipedia.org/wiki/Buddhist_calendar))
 - To calculate BE year manually, just add 543 to year. For example 26 May 1977 AD/CE should display as 26 May 2520 BE (1977 + 543)
 
 ```javascript
-import buddhistEra from 'dayjs/plugin/buddhistEra'
+import buddhistEra from "dayjs/plugin/buddhistEra";
 
-dayjs.extend(buddhistEra)
+dayjs.extend(buddhistEra);
 
-dayjs().format('BBBB BB')
+dayjs().format("BBBB BB");
 ```
 
 List of added formats:
 
-| Format | Output           | Description                           |
-| ------ | ---------------- | ------------------------------------- |
-| `BBBB` | 2561             | Full BE Year (Year + 543)             |
-| `BB`   | 61               | 2-digit of BE Year                    |
+| Format | Output | Description               |
+| ------ | ------ | ------------------------- |
+| `BBBB` | 2561   | Full BE Year (Year + 543) |
+| `BB`   | 61     | 2-digit of BE Year        |
 
-### WeekOfYear
- - WeekOfYear adds `.week()` API to returns a `number` indicating the `Dayjs`'s week of the year.
+### IsSameOrAfter
+
+- IsSameOrAfter adds `.isSameOrAfter()` API to returns a `boolean` indicating if a date is same of after another date.
 
 ```javascript
-import weekOfYear from 'dayjs/plugin/weekOfYear'
+import isSameOrAfter from "dayjs/plugin/isSameOrAfter";
 
-dayjs.extend(weekOfYear)
+dayjs.extend(isSameOrAfter);
 
-dayjs('06/27/2018').week() // 26
+dayjs("2010-10-20").isSameOrAfter("2010-10-19", "year");
 ```
 
-### IsSameOrAfter
- - IsSameOrAfter adds `.isSameOrAfter()` API to returns a `boolean` indicating if a date is same of after another date.
+### IsSameOrBefore
+
+- IsSameOrBefore adds `.isSameOrBefore()` API to returns a `boolean` indicating if a date is same of before another date.
 
 ```javascript
-import isSameOrAfter from 'dayjs/plugin/isSameOrAfter'
+import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
 
-dayjs.extend(isSameOrAfter)
+dayjs.extend(isSameOrBefore);
 
-dayjs('2010-10-20').isSameOrAfter('2010-10-19', 'year');
+dayjs("2010-10-20").isSameOrBefore("2010-10-19", "year");
 ```
 
-### IsSameOrBefore
- - IsSameOrBefore adds `.isSameOrBefore()` API to returns a `boolean` indicating if a date is same of before another date.
+### IsBetween
+
+- IsBetween adds `.isBetween()` API to returns a `boolean` indicating if a date is between two other dates.
 
 ```javascript
-import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'
+import isBetween from "dayjs/plugin/isBetween";
 
-dayjs.extend(isSameOrBefore)
+dayjs.extend(isBetween);
 
-dayjs('2010-10-20').isSameOrBefore('2010-10-19', 'year');
+dayjs("2010-10-20").isBetween("2010-10-19", dayjs("2010-10-25"), "year");
 ```
 
-### IsBetween
- - IsBetween adds `.isBetween()` API to returns a `boolean` indicating if a date is between two other dates.
+### DayOfYear
+
+- DayOfYear adds `.dayOfYear()` API to returns a `number` indicating the `Dayjs`'s day of the year.
+
+```javascript
+import dayOfYear from "dayjs/plugin/dayOfYear";
+
+dayjs.extend(dayOfYear);
+
+dayjs("2010-01-01").dayOfYear(); // 1
+```
+
+### WeekOfYear
+
+- WeekOfYear adds `.week()` API to returns a `number` indicating the `Dayjs`'s week of the year.
 
 ```javascript
-import isBetween from 'dayjs/plugin/isBetween'
+import weekOfYear from "dayjs/plugin/weekOfYear";
 
-dayjs.extend(isBetween)
+dayjs.extend(weekOfYear);
 
-dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25'), 'year');
+dayjs("2018-06-27").week(); // 26
 ```
 
 ### QuarterOfYear
+
 - QuarterOfYear add `.quarter()` API to return to which quarter of the year belongs a date
 
 ```javascript
-import quarterOfYear from 'dayjs/plugin/quarterOfYear'
+import quarterOfYear from "dayjs/plugin/quarterOfYear";
 
-dayjs.extend(quarterOfYear)
+dayjs.extend(quarterOfYear);
 
-dayjs('2010-04-01').quarter(); // 2
+dayjs("2010-04-01").quarter(); // 2
 ```
 
 ### CustomParseFormat
- - CustomParseFormat extends `dayjs()` constructor to support custom formats of input strings.
+
+- CustomParseFormat extends `dayjs()` constructor to support custom formats of input strings.
 
 To escape characters, wrap them in square brackets (e.g. `[G]`). Punctuation symbols (-:/.()) do not need to be wrapped.
 
 ```javascript
-import customParseFormat from 'dayjs/plugin/customParseFormat'
+import customParseFormat from "dayjs/plugin/customParseFormat";
 
-dayjs.extend(customParseFormat)
+dayjs.extend(customParseFormat);
 
-dayjs('05/02/69 1:02:03 PM -05:00', 'MM/DD/YY H:mm:ss A Z')
+dayjs("05/02/69 1:02:03 PM -05:00", "MM/DD/YY H:mm:ss A Z");
 // Returns an instance containing '1969-05-02T18:02:03.000Z'
 ```
 
 #### List of all available format tokens
 
-| Format | Output           | Description                       |
-| ------ | ---------------- | --------------------------------- |
-| `YY`   | 18               | Two-digit year                    |
-| `YYYY` | 2018             | Four-digit year                   |
-| `M`    | 1-12             | Month, beginning at 1             |
-| `MM`   | 01-12            | Month, 2-digits                   |
-| `D`    | 1-31             | Day of month                      |
-| `DD`   | 01-31            | Day of month, 2-digits            |
-| `H`    | 0-23             | Hours                             |
-| `HH`   | 00-23            | Hours, 2-digits                   |
-| `h`    | 1-12             | Hours, 12-hour clock              |
-| `hh`   | 01-12            | Hours, 12-hour clock, 2-digits    |
-| `m`    | 0-59             | Minutes                           |
-| `mm`   | 00-59            | Minutes, 2-digits                 |
-| `s`    | 0-59             | Seconds                           |
-| `ss`   | 00-59            | Seconds, 2-digits                 |
-| `S`    | 0-9              | Hundreds of milliseconds, 1-digit |
-| `SS`   | 00-99            | Tens of milliseconds, 2-digits    |
-| `SSS`  | 000-999          | Milliseconds, 3-digits            |
-| `Z`    | -5:00            | Offset from UTC                   |
-| `ZZ`   | -0500            | Compact offset from UTC, 2-digits |
-| `A`    | AM PM            | Post or ante meridiem, upper-case |
-| `a`    | am pm            | Post or ante meridiem, lower-case |
+| Format | Output  | Description                       |
+| ------ | ------- | --------------------------------- |
+| `YY`   | 18      | Two-digit year                    |
+| `YYYY` | 2018    | Four-digit year                   |
+| `M`    | 1-12    | Month, beginning at 1             |
+| `MM`   | 01-12   | Month, 2-digits                   |
+| `D`    | 1-31    | Day of month                      |
+| `DD`   | 01-31   | Day of month, 2-digits            |
+| `H`    | 0-23    | Hours                             |
+| `HH`   | 00-23   | Hours, 2-digits                   |
+| `h`    | 1-12    | Hours, 12-hour clock              |
+| `hh`   | 01-12   | Hours, 12-hour clock, 2-digits    |
+| `m`    | 0-59    | Minutes                           |
+| `mm`   | 00-59   | Minutes, 2-digits                 |
+| `s`    | 0-59    | Seconds                           |
+| `ss`   | 00-59   | Seconds, 2-digits                 |
+| `S`    | 0-9     | Hundreds of milliseconds, 1-digit |
+| `SS`   | 00-99   | Tens of milliseconds, 2-digits    |
+| `SSS`  | 000-999 | Milliseconds, 3-digits            |
+| `Z`    | -5:00   | Offset from UTC                   |
+| `ZZ`   | -0500   | Compact offset from UTC, 2-digits |
+| `A`    | AM PM   | Post or ante meridiem, upper-case |
+| `a`    | am pm   | Post or ante meridiem, lower-case |
 
 ## Customize
 
@@ -268,23 +291,24 @@ You could build your own Day.js plugin to meet different needs.
 Feel free to open a pull request to share your plugin.
 
 Template of a Day.js plugin.
+
 ```javascript
 export default (option, dayjsClass, dayjsFactory) => {
   // extend dayjs()
   // e.g. add dayjs().isSameOrBefore()
-  dayjsClass.prototype.isSameOrBefore = function (arguments) {}
+  dayjsClass.prototype.isSameOrBefore = function(arguments) {};
 
   // extend dayjs
   // e.g. add dayjs.utc()
-  dayjsFactory.utc = (arguments) => {}
+  dayjsFactory.utc = arguments => {};
 
   // overriding existing API
   // e.g. extend dayjs().format()
-  const oldFormat = dayjsClass.prototype.format
-  dayjsClass.prototype.format = function (arguments) {
+  const oldFormat = dayjsClass.prototype.format;
+  dayjsClass.prototype.format = function(arguments) {
     // original format result
-    const result = oldFormat(arguments)
+    const result = oldFormat(arguments);
     // return modified result
-  }
-}
-```
\ No newline at end of file
+  };
+};
+```
diff --git a/docs/es-es/Plugin.md b/docs/es-es/Plugin.md
index daa1fb079..4010e5be7 100644
--- a/docs/es-es/Plugin.md
+++ b/docs/es-es/Plugin.md
@@ -1,6 +1,6 @@
 # Lista de complementos
 
-Un complemento o *plugin* es un módulo independiente que puede añadirse a Day.js para extender su funcionalidad o añadir nuevas características.
+Un complemento o _plugin_ es un módulo independiente que puede añadirse a Day.js para extender su funcionalidad o añadir nuevas características.
 
 Por defecto, Day.js viene sin ningún complemento preinstalado, incluyendo únicamente el núcleo de la librería.
 
@@ -10,7 +10,7 @@ Puedes cargar diversos complementos según tus necesidades.
 
 ### Extend
 
-* Devuelve un objeto dayjs
+- Devuelve un objeto dayjs
 
 Método para declarar el uso de un complemento.
 
@@ -22,16 +22,16 @@ dayjs.extend(nombreComplemento, options) // uso del complemento con opciones
 
 ## Instalación
 
-* Vía NPM:
+- Vía NPM:
 
 ```javascript
-import dayjs from 'dayjs'
-import AdvancedFormat from 'dayjs/plugin/advancedFormat' // carga bajo demanda
+import dayjs from "dayjs";
+import AdvancedFormat from "dayjs/plugin/advancedFormat"; // carga bajo demanda
 
-dayjs.extend(AdvancedFormat) // uso del complemento
+dayjs.extend(AdvancedFormat); // uso del complemento
 ```
 
-* Vía CDN:
+- Vía CDN:
 
 ```html
 <script src="https://unpkg.com/dayjs"></script>
@@ -46,44 +46,44 @@ dayjs.extend(AdvancedFormat) // uso del complemento
 
 ### AdvancedFormat
 
-* AdvancedFormat extiende la API `dayjs().format` para proporcionar más opciones de formato.
+- AdvancedFormat extiende la API `dayjs().format` para proporcionar más opciones de formato.
 
 ```javascript
-import advancedFormat from 'dayjs/plugin/advancedFormat'
+import advancedFormat from "dayjs/plugin/advancedFormat";
 
-dayjs.extend(advancedFormat)
+dayjs.extend(advancedFormat);
 
-dayjs().format('Q Do k kk X x')
+dayjs().format("Q Do k kk X x");
 ```
 
 Lista de formatos añadidos:
 
-| Formato | Salida           | Descripción                           |
-| ------- | ---------------- | ------------------------------------- |
-| `Q`     | 1-4              | Cuarto                                |
-| `Do`    | 1º 2º ... 31º    | Día del mes con ordinal               |
-| `k`     | 1-23             | Hora, contando desde 1                |
-| `kk`    | 01-23            | Hora, con 2 dígitos, contando desde 1 |
-| `X`     | 1360013296       | Tiempo Unix en segundos               |
-| `x`     | 1360013296123    | Tiempo Unix en milisegundos           |
+| Formato | Salida        | Descripción                           |
+| ------- | ------------- | ------------------------------------- |
+| `Q`     | 1-4           | Cuarto                                |
+| `Do`    | 1º 2º ... 31º | Día del mes con ordinal               |
+| `k`     | 1-23          | Hora, contando desde 1                |
+| `kk`    | 01-23         | Hora, con 2 dígitos, contando desde 1 |
+| `X`     | 1360013296    | Tiempo Unix en segundos               |
+| `x`     | 1360013296123 | Tiempo Unix en milisegundos           |
 
 ### RelativeTime
 
-* RelativeTime añade las API `.from` `.to` `.fromNow` `.toNow` para dar formato de tiempo relativo a fechas (p.ej.: hace 3 horas).
+- RelativeTime añade las API `.from` `.to` `.fromNow` `.toNow` para dar formato de tiempo relativo a fechas (p.ej.: hace 3 horas).
 
 ```javascript
-import relativeTime from 'dayjs/plugin/relativeTime'
+import relativeTime from "dayjs/plugin/relativeTime";
 
-dayjs.extend(relativeTime)
+dayjs.extend(relativeTime);
 
-dayjs().from(dayjs('1990')) // hace 2 años
-dayjs().from(dayjs(), true) // 2 años
+dayjs().from(dayjs("1990")); // hace 2 años
+dayjs().from(dayjs(), true); // 2 años
 
-dayjs().fromNow()
+dayjs().fromNow();
 
-dayjs().to(dayjs())
+dayjs().to(dayjs());
 
-dayjs().toNow()
+dayjs().toNow();
 ```
 
 #### Tiempo desde ahora `.fromNow(withoutSuffix?: boolean)`
@@ -98,150 +98,154 @@ Devuelve un dato de tipo `string`, con el tiempo relativo desde el instante X.
 
 Devuelve dato de tipo `string`, con el tiempo relativo transcurrido desde la fecha representada por el objeto `Dayjs` dado hasta el instante actual.
 
-#### Tiempo hasta X  `.to(compared: Dayjs, withoutSuffix?: boolean)`
+#### Tiempo hasta X `.to(compared: Dayjs, withoutSuffix?: boolean)`
 
 Devuelve dato de tipo `string`, con el tiempo relativo transcurrido desde la fecha representada por el objeto `Dayjs` dado hasta el instante X especificado.
 
-| Rango                        | Clave  | Ejemplo de salida                  |
-| ---------------------------- | ------ | ---------------------------------- |
-| de 0 a 44 segundos           | s      | hace unos segundos                 |
-| de 45 a 89 segundos          | m      | hace un minuto                     |
-| de 90 segundos a 44 minutos  | mm     | hace 2 minutos ... hace 44 minutos |
-| de 45 a 89 minutos           | h      | hace una hora                      |
-| de 90 minutos a 21 horas     | hh     | hace 2 horas ... hace 21 horas     |
-| de 22 a 35 horas             | d      | hace un día                        |
-| de 36 horas a 25 días        | dd     | hace 2 días ... hace 25 días       |
-| de 26 a 45 días              | M      | hace un mes                        |
-| de 46 días a 10 meses        | MM     | hace 2 meses ... hace 10 meses     |
-| de 11 a 17 meses             | y      | hace un año                        |
-| más de 18 meses              | yy     | hace 2 años ... hace 20 años       |
+| Rango                       | Clave | Ejemplo de salida                  |
+| --------------------------- | ----- | ---------------------------------- |
+| de 0 a 44 segundos          | s     | hace unos segundos                 |
+| de 45 a 89 segundos         | m     | hace un minuto                     |
+| de 90 segundos a 44 minutos | mm    | hace 2 minutos ... hace 44 minutos |
+| de 45 a 89 minutos          | h     | hace una hora                      |
+| de 90 minutos a 21 horas    | hh    | hace 2 horas ... hace 21 horas     |
+| de 22 a 35 horas            | d     | hace un día                        |
+| de 36 horas a 25 días       | dd    | hace 2 días ... hace 25 días       |
+| de 26 a 45 días             | M     | hace un mes                        |
+| de 46 días a 10 meses       | MM    | hace 2 meses ... hace 10 meses     |
+| de 11 a 17 meses            | y     | hace un año                        |
+| más de 18 meses             | yy    | hace 2 años ... hace 20 años       |
 
 ### IsLeapYear
 
-* IsLeapYear añade la API `.isLeapYear`, que devuelve un dato de tipo `boolean` indicando si el año del objeto `Dayjs` es bisiesto o no.
+- IsLeapYear añade la API `.isLeapYear`, que devuelve un dato de tipo `boolean` indicando si el año del objeto `Dayjs` es bisiesto o no.
 
 ```javascript
-import isLeapYear from 'dayjs/plugin/isLeapYear'
+import isLeapYear from "dayjs/plugin/isLeapYear";
 
-dayjs.extend(isLeapYear)
+dayjs.extend(isLeapYear);
 
-dayjs('2000-01-01').isLeapYear(); // true
+dayjs("2000-01-01").isLeapYear(); // true
 ```
 
 ### BuddhistEra
 
-* BuddhistEra extiende la API `dayjs().format` para añadir opciones de formato relacionadas con la Era Budista (B.E.)
-* La Era Budista es un sistema de numeración anual, usado principalmente en los países del sudeste del continente asiático: Camboya, Laos, Birmania y Tailandia,así como en Sri Lanka y entre la población china de Malasia y Singapur, por razones religiosas o en eventos oficiales ([Wikipedia](https://en.wikipedia.org/wiki/Buddhist_calendar))
-* Para calcular manualmente el año de la BE tan sólo hemos de sumar 543 al año. Por ejemplo, el 26 Mayo 1977 AD/EC debe mostrarse como 26 Mayo 2520 BE (1977 + 543)
+- BuddhistEra extiende la API `dayjs().format` para añadir opciones de formato relacionadas con la Era Budista (B.E.)
+- La Era Budista es un sistema de numeración anual, usado principalmente en los países del sudeste del continente asiático: Camboya, Laos, Birmania y Tailandia,así como en Sri Lanka y entre la población china de Malasia y Singapur, por razones religiosas o en eventos oficiales ([Wikipedia](https://en.wikipedia.org/wiki/Buddhist_calendar))
+- Para calcular manualmente el año de la BE tan sólo hemos de sumar 543 al año. Por ejemplo, el 26 Mayo 1977 AD/EC debe mostrarse como 26 Mayo 2520 BE (1977 + 543)
 
 ```javascript
-import buddhistEra from 'dayjs/plugin/buddhistEra'
+import buddhistEra from "dayjs/plugin/buddhistEra";
 
-dayjs.extend(buddhistEra)
+dayjs.extend(buddhistEra);
 
-dayjs().format('BBBB BB')
+dayjs().format("BBBB BB");
 ```
 
 Lista de formatos añadidos:
 
-| Formato | Salida           | Descripción                           |
-| ------- | ---------------- | ------------------------------------- |
-| `BBBB`  | 2561             | Año BE completo (Año + 543)           |
-| `BB`    | 61               | Año BE con 2 dígitos                  |
+| Formato | Salida | Descripción                 |
+| ------- | ------ | --------------------------- |
+| `BBBB`  | 2561   | Año BE completo (Año + 543) |
+| `BB`    | 61     | Año BE con 2 dígitos        |
 
-### WeekOfYear
+### IsSameOrAfter
 
-* WeekOfYear añade la API `.week()`, que devuelve un dato de tipo `number` indicando la semana del año correspondiente a la fecha del objeto `Dayjs`.
+- IsSameOrAfter adds `.isSameOrAfter()` API to returns a `boolean` indicating if a date is same of after another date.
 
 ```javascript
-import weekOfYear from 'dayjs/plugin/weekOfYear'
+import isSameOrAfter from "dayjs/plugin/isSameOrAfter";
 
-dayjs.extend(weekOfYear)
+dayjs.extend(isSameOrAfter);
 
-dayjs('06/27/2018').week() // 26
+dayjs("2010-10-20").isSameOrAfter("2010-10-19", "year");
 ```
 
-### IsSameOrAfter
- - IsSameOrAfter adds `.isSameOrAfter()` API to returns a `boolean` indicating if a date is same of after another date.
+### IsSameOrBefore
+
+- IsSameOrBefore adds `.isSameOrBefore()` API to returns a `boolean` indicating if a date is same of before another date.
 
 ```javascript
-import isSameOrAfter from 'dayjs/plugin/isSameOrAfter'
+import isSameOrBefore from "dayjs/plugin/isSameOrBefore";
 
-dayjs.extend(isSameOrAfter)
+dayjs.extend(isSameOrBefore);
 
-dayjs('2010-10-20').isSameOrAfter('2010-10-19', 'year');
+dayjs("2010-10-20").isSameOrBefore("2010-10-19", "year");
 ```
 
-### IsSameOrBefore
- - IsSameOrBefore adds `.isSameOrBefore()` API to returns a `boolean` indicating if a date is same of before another date.
+### IsBetween
+
+- IsBetween añade la API `.isBetween()`, que devuelve un dato de tipo `boolean` indicando si una fecha se encuentra o no entre otras dos dadas.
 
 ```javascript
-import isSameOrBefore from 'dayjs/plugin/isSameOrBefore'
+import isBetween from "dayjs/plugin/isBetween";
 
-dayjs.extend(isSameOrBefore)
+dayjs.extend(isBetween);
 
-dayjs('2010-10-20').isSameOrBefore('2010-10-19', 'year');
+dayjs("2010-10-20").isBetween("2010-10-19", dayjs("2010-10-25"), "year");
 ```
 
-### IsBetween
+### DayOfYear
 
-* IsBetween añade la API `.isBetween()`, que devuelve un dato de tipo `boolean` indicando si una fecha se encuentra o no entre otras dos dadas.
+- DayOfYear añade a la API `.dayOfYear()`, que devuelve un dato de tipo `number` indicando el día del año correspondiente a la fecha del objeto `Dayjs`.
 
 ```javascript
-import isBetween from 'dayjs/plugin/isBetween'
+import dayOfYear from "dayjs/plugin/dayOfYear";
 
-dayjs.extend(isBetween)
+dayjs.extend(dayOfYear);
 
-dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25'), 'year');
+dayjs("2018-01-01").week(); // 1
 ```
 
-### QuarterOfYear
-- QuarterOfYear añade a la API `.quarter()` para devolver a que cuarto del año pertenece una fecha
+### WeekOfYear
+
+- WeekOfYear añade la API `.week()`, que devuelve un dato de tipo `number` indicando la semana del año correspondiente a la fecha del objeto `Dayjs`.
 
 ```javascript
-import quarterOfYear from 'dayjs/plugin/quarterOfYear'
+import weekOfYear from "dayjs/plugin/weekOfYear";
 
-dayjs.extend(quarterOfYear)
+dayjs.extend(weekOfYear);
 
-dayjs('2010-04-01').quarter(); // 2
+dayjs("2018-06-27").week(); // 26
 ```
 
 ### QuarterOfYear
-- QuarterOfYear add `.quarter()` API to return to which quarter of the year belongs a date
+
+- QuarterOfYear añade a la API `.quarter()` para devolver a que cuarto del año pertenece una fecha
 
 ```javascript
-import quarterOfYear from 'dayjs/plugin/quarterOfYear'
+import quarterOfYear from "dayjs/plugin/quarterOfYear";
 
-dayjs.extend(quarterOfYear)
+dayjs.extend(quarterOfYear);
 
-dayjs('2010-04-01').quarter(); // 2
+dayjs("2010-04-01").quarter(); // 2
 ```
 
 #### List of all available format tokens
 
-| Format | Output           | Description                       |
-| ------ | ---------------- | --------------------------------- |
-| `YY`   | 18               | Two-digit year                    |
-| `YYYY` | 2018             | Four-digit year                   |
-| `M`    | 1-12             | Month, beginning at 1             |
-| `MM`   | 01-12            | Month, 2-digits                   |
-| `D`    | 1-31             | Day of month                      |
-| `DD`   | 01-31            | Day of month, 2-digits            |
-| `H`    | 0-23             | Hours                             |
-| `HH`   | 00-23            | Hours, 2-digits                   |
-| `h`    | 1-12             | Hours, 12-hour clock              |
-| `hh`   | 01-12            | Hours, 12-hour clock, 2-digits    |
-| `m`    | 0-59             | Minutes                           |
-| `mm`   | 00-59            | Minutes, 2-digits                 |
-| `s`    | 0-59             | Seconds                           |
-| `ss`   | 00-59            | Seconds, 2-digits                 |
-| `S`    | 0-9              | Hundreds of milliseconds, 1-digit |
-| `SS`   | 00-99            | Tens of milliseconds, 2-digits    |
-| `SSS`  | 000-999          | Milliseconds, 3-digits            |
-| `Z`    | -5:00            | Offset from UTC                   |
-| `ZZ`   | -0500            | Compact offset from UTC, 2-digits |
-| `A`    | AM PM            | Post or ante meridiem, upper-case |
-| `a`    | am pm            | Post or ante meridiem, lower-case |
+| Format | Output  | Description                       |
+| ------ | ------- | --------------------------------- |
+| `YY`   | 18      | Two-digit year                    |
+| `YYYY` | 2018    | Four-digit year                   |
+| `M`    | 1-12    | Month, beginning at 1             |
+| `MM`   | 01-12   | Month, 2-digits                   |
+| `D`    | 1-31    | Day of month                      |
+| `DD`   | 01-31   | Day of month, 2-digits            |
+| `H`    | 0-23    | Hours                             |
+| `HH`   | 00-23   | Hours, 2-digits                   |
+| `h`    | 1-12    | Hours, 12-hour clock              |
+| `hh`   | 01-12   | Hours, 12-hour clock, 2-digits    |
+| `m`    | 0-59    | Minutes                           |
+| `mm`   | 00-59   | Minutes, 2-digits                 |
+| `s`    | 0-59    | Seconds                           |
+| `ss`   | 00-59   | Seconds, 2-digits                 |
+| `S`    | 0-9     | Hundreds of milliseconds, 1-digit |
+| `SS`   | 00-99   | Tens of milliseconds, 2-digits    |
+| `SSS`  | 000-999 | Milliseconds, 3-digits            |
+| `Z`    | -5:00   | Offset from UTC                   |
+| `ZZ`   | -0500   | Compact offset from UTC, 2-digits |
+| `A`    | AM PM   | Post or ante meridiem, upper-case |
+| `a`    | am pm   | Post or ante meridiem, lower-case |
 
 ## Personalización
 
@@ -255,19 +259,19 @@ Plantilla de un complemento de Day.js.
 export default (option, dayjsClass, dayjsFactory) => {
   // extensión de dayjs()
   // p.ej.: se añade dayjs().isSameOrBefore()
-  dayjsClass.prototype.isSameOrBefore = function (arguments) {}
+  dayjsClass.prototype.isSameOrBefore = function(arguments) {};
 
   // extensión de dayjs
   // p.ej.: se añade dayjs.utc()
-  dayjsFactory.utc = (arguments) => {}
+  dayjsFactory.utc = arguments => {};
 
   // sobrescritura de la API existente
   // p.ej.: extensión de dayjs().format()
-  const oldFormat = dayjsClass.prototype.format
-  dayjsClass.prototype.format = function (arguments) {
+  const oldFormat = dayjsClass.prototype.format;
+  dayjsClass.prototype.format = function(arguments) {
     // result contiene el formato original
-    const result = oldFormat(arguments)
+    const result = oldFormat(arguments);
     // se ha de devolver result modificado
-  }
-}
-```
\ No newline at end of file
+  };
+};
+```
diff --git a/src/plugin/dayOfYear/index.js b/src/plugin/dayOfYear/index.js
new file mode 100644
index 000000000..018ef3396
--- /dev/null
+++ b/src/plugin/dayOfYear/index.js
@@ -0,0 +1,7 @@
+export default (o, c) => {
+  const proto = c.prototype
+  proto.dayOfYear = function (input) {
+    const dayOfYear = Math.round((this.startOf('day') - this.startOf('year')) / 864e5) + 1
+    return input == null ? dayOfYear : this.add(input - dayOfYear, 'day')
+  }
+}
diff --git a/test/plugin/dayOfYear.test.js b/test/plugin/dayOfYear.test.js
new file mode 100644
index 000000000..a1b5979a1
--- /dev/null
+++ b/test/plugin/dayOfYear.test.js
@@ -0,0 +1,47 @@
+import MockDate from 'mockdate'
+import dayjs from '../../src'
+import dayOfYear from '../../src/plugin/dayOfYear'
+
+dayjs.extend(dayOfYear)
+
+beforeEach(() => {
+  MockDate.set(new Date())
+})
+
+afterEach(() => {
+  MockDate.reset()
+})
+
+it('DayOfYear get', () => {
+  expect(dayjs('2015-01-01T00:00:00.000').dayOfYear()).toBe(1)
+  expect(dayjs('2015-01-31T00:00:00.000').dayOfYear()).toBe(31)
+  expect(dayjs('2015-02-01T00:00:00.000').dayOfYear()).toBe(32)
+  expect(dayjs('2015-02-28T00:00:00.000').dayOfYear()).toBe(59)
+  expect(dayjs('2015-12-31T00:00:00.000').dayOfYear()).toBe(365)
+})
+
+it('DayOfYear set', () => {
+  expect(dayjs('2015-01-01T00:00:00.000Z')
+    .dayOfYear(4)
+    .dayOfYear()).toBe(4)
+
+  expect(dayjs('2015-01-01T00:00:00.000Z')
+    .dayOfYear(4)
+    .toISOString()).toBe('2015-01-04T00:00:00.000Z')
+
+  expect(dayjs('2015-01-01T00:00:00.000Z')
+    .dayOfYear(32)
+    .dayOfYear()).toBe(32)
+
+  expect(dayjs('2015-01-01T00:00:00.000Z')
+    .dayOfYear(32)
+    .toISOString()).toBe('2015-02-01T00:00:00.000Z')
+
+  expect(dayjs('2015-01-01T00:00:00.000Z')
+    .dayOfYear(365)
+    .dayOfYear()).toBe(365)
+
+  expect(dayjs('2015-01-01T00:00:00.000Z')
+    .dayOfYear(365)
+    .toISOString()).toBe('2015-12-31T00:00:00.000Z')
+})

From a6658668ce5bb181bb182371bcbee2368b2e6d00 Mon Sep 17 00:00:00 2001
From: iamkun <kunhello@outlook.com>
Date: Sat, 2 Feb 2019 15:18:35 +0800
Subject: [PATCH 08/11] test: update dayOfYear test

---
 test/plugin/dayOfYear.test.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/test/plugin/dayOfYear.test.js b/test/plugin/dayOfYear.test.js
index a1b5979a1..b69b1c37c 100644
--- a/test/plugin/dayOfYear.test.js
+++ b/test/plugin/dayOfYear.test.js
@@ -1,4 +1,5 @@
 import MockDate from 'mockdate'
+import moment from 'moment'
 import dayjs from '../../src'
 import dayOfYear from '../../src/plugin/dayOfYear'
 
@@ -13,6 +14,7 @@ afterEach(() => {
 })
 
 it('DayOfYear get', () => {
+  expect(dayjs().dayOfYear()).toBe(moment().dayOfYear())
   expect(dayjs('2015-01-01T00:00:00.000').dayOfYear()).toBe(1)
   expect(dayjs('2015-01-31T00:00:00.000').dayOfYear()).toBe(31)
   expect(dayjs('2015-02-01T00:00:00.000').dayOfYear()).toBe(32)
@@ -21,6 +23,7 @@ it('DayOfYear get', () => {
 })
 
 it('DayOfYear set', () => {
+  expect(dayjs().dayOfYear(4).dayOfYear()).toBe(moment().dayOfYear(4).dayOfYear())
   expect(dayjs('2015-01-01T00:00:00.000Z')
     .dayOfYear(4)
     .dayOfYear()).toBe(4)

From 0e8a1d50aee48fb789f40d4dd08f3961f50c0624 Mon Sep 17 00:00:00 2001
From: iamkun <kunhello@outlook.com>
Date: Sat, 2 Feb 2019 15:32:05 +0800
Subject: [PATCH 09/11] docs: update api docs

---
 docs/en/API-reference.md    |  2 +-
 docs/es-es/API-reference.md |  5 +++--
 docs/ja/API-reference.md    | 12 +++++++++++-
 docs/ko/API-reference.md    | 12 +++++++++++-
 docs/pt-br/API-reference.md | 12 +++++++++++-
 docs/zh-cn/API-reference.md | 13 ++++++++++++-
 6 files changed, 49 insertions(+), 7 deletions(-)

diff --git a/docs/en/API-reference.md b/docs/en/API-reference.md
index 6c3ec69a2..d30f9e5d5 100644
--- a/docs/en/API-reference.md
+++ b/docs/en/API-reference.md
@@ -334,7 +334,7 @@ dayjs("2019-01-25").unix(); // 1548381600
 Returns the UTC offset in minutes for the `Dayjs`.
 
 ```js
-dayjs("2013-03-07T07:00:00+08:00").utcOffset(); // 60
+dayjs().utcOffset();
 ```
 
 ### Days in the Month `.daysInMonth()`
diff --git a/docs/es-es/API-reference.md b/docs/es-es/API-reference.md
index 2aeb9ffad..cb7bf91c1 100644
--- a/docs/es-es/API-reference.md
+++ b/docs/es-es/API-reference.md
@@ -297,7 +297,8 @@ dayjs("2019-01-25").format("DD/MM/YYYY"); // '25/01/2019'
 | `A`     | AM PM            |                                          |
 | `a`     | am pm            |                                          |
 
-\* Más formatos disponibles `Q Do k kk X x ...` con el complemento [`AdvancedFormat`](./Plugin.md#advancedformat)
+- Más formatos disponibles `Q Do k kk X x ...` con el complemento [`AdvancedFormat`](./Plugin.md#advancedformat)
+- Localized format options `L LT LTS ...` in plugin [`LocalizedFormat`](./Plugin.md#localizedFormat)
 
 ### Diferencia `.diff(compared: Dayjs, unit: string (predeterminada: 'milliseconds'), float?: boolean)`
 
@@ -333,7 +334,7 @@ dayjs("2019-01-25").unix(); // 1548381600
 Devuelve el UTC offset en minutos del `Dayjs`.
 
 ```js
-dayjs("2013-03-07T07:00:00+08:00").utcOffset(); // 60
+dayjs().utcOffset();
 ```
 
 ### Días en el mes `.daysInMonth()`
diff --git a/docs/ja/API-reference.md b/docs/ja/API-reference.md
index ed2e4541d..074384683 100644
--- a/docs/ja/API-reference.md
+++ b/docs/ja/API-reference.md
@@ -33,6 +33,7 @@ Day.js は組み込みの `Date.prototype` を変更する代わりに `Dayjs` 
   * [Difference](#difference)
   * [Unix Timestamp (milliseconds)](#unix-timestamp-milliseconds-1)
   * [Unix Timestamp (seconds)](#unix-timestamp-seconds)
+  * [UTC offset (minutes)](#utc-offset-minutes-utcoffset)
   * [Days in Month](#days-in-month)
   * [As Javascript Date](#as-javascript-date)
   * [As Array](#as-array)
@@ -339,7 +340,8 @@ dayjs().format('{YYYY} MM-DDTHH:mm:ssZ[Z]'); // "{2014} 09-08T08:02:17-05:00Z"
 | `A`    | AM PM            | 午前と午後 (大文字)                                      |
 | `a`    | am pm            | 午前と午後 (小文字)                                      |
 
-* plugin [`AdvancedFormat`](./Plugin.md#advancedformat) にはより多くのフォーマット(例: `Q Do k kk X x ...` )が存在します。
+- plugin [`AdvancedFormat`](./Plugin.md#advancedformat) にはより多くのフォーマット(例: `Q Do k kk X x ...` )が存在します。
+- Localized format options `L LT LTS ...` in plugin [`LocalizedFormat`](./Plugin.md#localizedFormat)
 
 #### Difference
 
@@ -376,6 +378,14 @@ Unix タイムスタンプ (Unix エポックからの秒数) を出力します
 dayjs().unix();
 ```
 
+### UTC Offset (minutes)
+
+Returns the UTC offset in minutes for the `Dayjs`.
+
+```js
+dayjs().utcOffset();
+```
+
 #### Days in Month
 
 * Number を返します
diff --git a/docs/ko/API-reference.md b/docs/ko/API-reference.md
index 686b989a3..601fb8628 100644
--- a/docs/ko/API-reference.md
+++ b/docs/ko/API-reference.md
@@ -35,6 +35,7 @@ Day.js는 네이티브 `Date.prototype`을 수정하는 대신 `Dayjs` 오브젝
     - [Difference `.diff(compared: Dayjs, unit: string (default: 'milliseconds'), float?: boolean)`](#difference-diffcompared--dayjs--unit--string-default--milliseconds--float--boolean)
     - [Unix Timestamp (milliseconds) `.valueOf()`](#unix-timestamp-milliseconds-valueof)
     - [Unix Timestamp (seconds) `.unix()`](#unix-timestamp-seconds-unix)
+    - [UTC offset (minutes) `.utcOffset()`](#utc-offset-minutes-utcoffset)
     - [Days in the Month `.daysInMonth()`](#days-in-the-month-daysinmonth)
     - [As Javascript Date `.toDate()`](#as-javascript-date-todate)
     - [As Array `.toArray()`](#as-array-toarray)
@@ -293,7 +294,8 @@ dayjs('2019-01-25').format('DD/MM/YYYY'); // '25/01/2019'
 | `A`    | AM PM            |                                       |
 | `a`    | am pm            |                                       |
 
-* 플러그인 [`AdvancedFormat`](./Plugin.md#advancedformat) 을 사용하면 더 많은 형식(`Q Do k kk X x ...`)을 사용할 수 있습니다.
+- 플러그인 [`AdvancedFormat`](./Plugin.md#advancedformat) 을 사용하면 더 많은 형식(`Q Do k kk X x ...`)을 사용할 수 있습니다.
+- Localized format options `L LT LTS ...` in plugin [`LocalizedFormat`](./Plugin.md#localizedFormat)
 
 ### Difference `.diff(compared: Dayjs, unit: string (default: 'milliseconds'), float?: boolean)`
 
@@ -324,6 +326,14 @@ dayjs('2019-01-25').valueOf(); // 1548381600000
 dayjs('2019-01-25').unix(); // 1548381600
 ```
 
+### UTC Offset (minutes) `.utcOffset()`
+
+Returns the UTC offset in minutes for the `Dayjs`.
+
+```js
+dayjs().utcOffset();
+```
+
 ### Days in the Month `.daysInMonth()`
 
 `Dayjs`에서 표기하는 달에서 일수를 가져옵니다. 반환 타입은 `number` 입니다.
diff --git a/docs/pt-br/API-reference.md b/docs/pt-br/API-reference.md
index b3e0923d7..d39925d6a 100644
--- a/docs/pt-br/API-reference.md
+++ b/docs/pt-br/API-reference.md
@@ -36,6 +36,7 @@ O objeto `Dayjs` é imutável, ou seja, todas as operações da API que alteram
     - [Diferença `.diff(compared: Dayjs, unit: string (padrão: 'milliseconds'), float?: boolean)`](#diferença-diffcompared-dayjs-unit-string-padrão-milliseconds-float-boolean)
     - [Unix Timestamp (milissegundos) `.valueOf()`](#unix-timestamp-milissegundos-valueof)
     - [Unix Timestamp (segundos) `.unix()`](#unix-timestamp-segundos-unix)
+    - [UTC offset (minutes) `.utcOffset()`](#utc-offset-minutes-utcoffset)
     - [Dias no Mês `.daysInMonth()`](#dias-no-mês-daysinmonth)
     - [Como objeto `Date` do Javascript `.toDate()`](#como-objeto-date-do-javascript-todate)
     - [Como Array `.toArray()`](#como-array-toarray)
@@ -292,7 +293,8 @@ dayjs('2019-01-25').format('DD/MM/YYYY'); // '25/01/2019'
 | `A`     | AM PM            |                                               |
 | `a`     | am pm            |                                               |
 
-* Mais formatos disponíveis `Q Do k kk X x ...` no plugin [`AdvancedFormat`](./Plugin.md#advancedformat)
+- Mais formatos disponíveis `Q Do k kk X x ...` no plugin [`AdvancedFormat`](./Plugin.md#advancedformat)
+- Localized format options `L LT LTS ...` in plugin [`LocalizedFormat`](./Plugin.md#localizedFormat)
 
 ### Diferença `.diff(compared: Dayjs, unit: string (padrão: 'milliseconds'), float?: boolean)`
 
@@ -323,6 +325,14 @@ Retorna um `number` em segundos desde a Unix Epoch para o objeto `Dayjs`.
 dayjs('2019-01-25').unix(); // 1548381600
 ```
 
+### UTC Offset (minutes) `.utcOffset()`
+
+Returns the UTC offset in minutes for the `Dayjs`.
+
+```js
+dayjs().utcOffset();
+```
+
 ### Dias no Mês `.daysInMonth()`
 
 Retorna um `number` em contendo o número de dias no mês do objeto `Dayjs`.
diff --git a/docs/zh-cn/API-reference.md b/docs/zh-cn/API-reference.md
index 3b0406aed..4f709f022 100644
--- a/docs/zh-cn/API-reference.md
+++ b/docs/zh-cn/API-reference.md
@@ -33,6 +33,7 @@
   * [时间差](#时间差)
   * [Unix 时间戳 (毫秒)](#unix-时间戳-毫秒-1)
   * [Unix 时间戳 (秒)](#unix-时间戳-秒)
+  - [UTC 偏移量 (分)](#utc-偏移量-分)
   * [天数 (月)](#天数-月)
   * [Date 对象](#date-对象-1)
   * [数组](#数组)
@@ -262,7 +263,8 @@ dayjs().format("{YYYY} MM-DDTHH:mm:ssZ[Z]"); // "{2014} 09-08T08:02:17-05:00Z"
 | `A`    | AM PM            |                              |
 | `a`    | am pm            |                              |
 
-* 更多格式化的选项 `Q Do k kk X x ...` 可以使用插件 [`AdvancedFormat`](./Plugin.md#advancedformat)
+- 更多格式化的选项 `Q Do k kk X x ...` 可以使用插件 [`AdvancedFormat`](./Plugin.md#advancedformat)
+- 本地化的长日期格式 `L LT LTS ...` 可以使用插件 [`LocalizedFormat`](./Plugin.md#localizedFormat)
 
 #### 时间差
 - return Number
@@ -290,6 +292,15 @@ dayjs().valueOf();
 ```js
 dayjs().unix();
 ```
+
+### UTC 偏移量 (分)
+
+返回 UTC 偏移量 (分)
+
+```js
+dayjs().utcOffset();
+```
+
 #### 天数 (月)
 - return Number
 

From 4ecb524b30c186cf107ca55baaf6d76e5e8c1ae9 Mon Sep 17 00:00:00 2001
From: iamkun <kunhello@outlook.com>
Date: Sat, 2 Feb 2019 15:41:26 +0800
Subject: [PATCH 10/11] docs: update plugin docs

---
 docs/en/Plugin.md    |  2 +-
 docs/es-es/Plugin.md | 22 ++++++++++++++++
 docs/ja/Plugin.md    | 54 +++++++++++++++++++++++++++++++--------
 docs/ko/Plugin.md    | 56 +++++++++++++++++++++++++++++++++--------
 docs/pt-br/Plugin.md | 55 ++++++++++++++++++++++++++++++++--------
 docs/zh-cn/Plugin.md | 60 ++++++++++++++++++++++++++++++++++----------
 6 files changed, 203 insertions(+), 46 deletions(-)

diff --git a/docs/en/Plugin.md b/docs/en/Plugin.md
index 692e2e9aa..654898090 100644
--- a/docs/en/Plugin.md
+++ b/docs/en/Plugin.md
@@ -68,7 +68,7 @@ List of added formats:
 | `x`    | 1360013296123    | Unix Timestamp in millisecond      |
 
 ### LocalizedFormat
- - LocalizedFormat extends `dayjs().format` API to supply localized format options known from Moment.js.
+ - LocalizedFormat extends `dayjs().format` API to supply localized format options.
 
 ```javascript
 import LocalizedFormat from 'dayjs/plugin/localizedFormat'
diff --git a/docs/es-es/Plugin.md b/docs/es-es/Plugin.md
index 4010e5be7..5260cc019 100644
--- a/docs/es-es/Plugin.md
+++ b/docs/es-es/Plugin.md
@@ -67,6 +67,28 @@ Lista de formatos añadidos:
 | `X`     | 1360013296    | Tiempo Unix en segundos               |
 | `x`     | 1360013296123 | Tiempo Unix en milisegundos           |
 
+### LocalizedFormat
+ - LocalizedFormat extends `dayjs().format` API to supply localized format options.
+
+```javascript
+import LocalizedFormat from 'dayjs/plugin/localizedFormat'
+
+dayjs.extend(LocalizedFormat)
+
+dayjs().format('L LT')
+```
+
+List of added formats:
+
+| Format | English Locale            | Sample Output                     |
+| ------ | ------------------------- | --------------------------------- |
+| `LT`   | h:mm A                    | 8:02 PM                           |
+| `LTS`  | h:mm:ss A                 | 8:02:18 PM                        |
+| `L`    | MM/DD/YYYY                | 08/16/2018                        |
+| `LL`   | MMMM D, YYYY              | August 16, 2018                   |
+| `LLL`  | MMMM D, YYYY h:mm A       | August 16, 2018 8:02 PM           |
+| `LLLL` | dddd, MMMM D, YYYY h:mm A | Thursday, August 16, 2018 8:02 PM |
+
 ### RelativeTime
 
 - RelativeTime añade las API `.from` `.to` `.fromNow` `.toNow` para dar formato de tiempo relativo a fechas (p.ej.: hace 3 horas).
diff --git a/docs/ja/Plugin.md b/docs/ja/Plugin.md
index 6831a689e..d86b95945 100644
--- a/docs/ja/Plugin.md
+++ b/docs/ja/Plugin.md
@@ -66,6 +66,28 @@ dayjs().format('Q Do k kk X x')
 | `X`    | 1360013296       | Unix タイムスタンプ (秒)              |
 | `x`    | 1360013296123    | Unix タイムスタンプ (ミリ秒)         |
 
+### LocalizedFormat
+ - LocalizedFormat extends `dayjs().format` API to supply localized format options.
+
+```javascript
+import LocalizedFormat from 'dayjs/plugin/localizedFormat'
+
+dayjs.extend(LocalizedFormat)
+
+dayjs().format('L LT')
+```
+
+List of added formats:
+
+| Format | English Locale            | Sample Output                     |
+| ------ | ------------------------- | --------------------------------- |
+| `LT`   | h:mm A                    | 8:02 PM                           |
+| `LTS`  | h:mm:ss A                 | 8:02:18 PM                        |
+| `L`    | MM/DD/YYYY                | 08/16/2018                        |
+| `LL`   | MMMM D, YYYY              | August 16, 2018                   |
+| `LLL`  | MMMM D, YYYY h:mm A       | August 16, 2018 8:02 PM           |
+| `LLLL` | dddd, MMMM D, YYYY h:mm A | Thursday, August 16, 2018 8:02 PM |
+
 ### RelativeTime
  - RelativeTime は日付を文字列で表現された相対的な時刻(例: 3 hours ago)にフォーマットする `.from` `.to` `.fromNow` `.toNow` APIを追加します。
 
@@ -154,16 +176,6 @@ dayjs().format('BBBB BB')
 | `BBBB`    | 2561 | 完全な仏暦 (年 + 543) |
 | `BB`      | 61   | 2桁の仏暦            |
 
-### WeekOfYear
- - WeekOfYear はある `Dayjs` オブジェクトがその年の何週目であるかを `Number` で返す `.week()` APIを追加します。
-
-```javascript
-import weekOfYear from 'dayjs/plugin/weekOfYear'
-
-dayjs.extend(weekOfYear)
-
-dayjs('06/27/2018').week() // 26
-```
 ### IsSameOrAfter
  - IsSameOrAfter はある日付が別の日付と同じまたはそれ以降であるかどうかを `Boolean` で返す `.isSameOrAfter()` APIを追加します。
 
@@ -196,6 +208,28 @@ dayjs.extend(isBetween)
 
 dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25'), 'year');
 ```
+### DayOfYear
+
+- DayOfYear adds `.dayOfYear()` API to returns a `number` indicating the `Dayjs`'s day of the year.
+
+```javascript
+import dayOfYear from "dayjs/plugin/dayOfYear";
+
+dayjs.extend(dayOfYear);
+
+dayjs("2010-01-01").dayOfYear(); // 1
+```
+
+### WeekOfYear
+ - WeekOfYear はある `Dayjs` オブジェクトがその年の何週目であるかを `Number` で返す `.week()` APIを追加します。
+
+```javascript
+import weekOfYear from 'dayjs/plugin/weekOfYear'
+
+dayjs.extend(weekOfYear)
+
+dayjs('06/27/2018').week() // 26
+```
 
 ### QuarterOfYear
 - QuarterOfYear add `.quarter()` API to return to which quarter of the year belongs a date
diff --git a/docs/ko/Plugin.md b/docs/ko/Plugin.md
index 357b2be11..641567ef0 100644
--- a/docs/ko/Plugin.md
+++ b/docs/ko/Plugin.md
@@ -65,6 +65,28 @@ dayjs().format('Q Do k kk X x')
 | `X`    | 1360013296       | 유닉스 타임스템프, 초                  |
 | `x`    | 1360013296123    | 유닉스 타임스탬프, 밀리 초             |
 
+### LocalizedFormat
+ - LocalizedFormat extends `dayjs().format` API to supply localized format options.
+
+```javascript
+import LocalizedFormat from 'dayjs/plugin/localizedFormat'
+
+dayjs.extend(LocalizedFormat)
+
+dayjs().format('L LT')
+```
+
+List of added formats:
+
+| Format | English Locale            | Sample Output                     |
+| ------ | ------------------------- | --------------------------------- |
+| `LT`   | h:mm A                    | 8:02 PM                           |
+| `LTS`  | h:mm:ss A                 | 8:02:18 PM                        |
+| `L`    | MM/DD/YYYY                | 08/16/2018                        |
+| `LL`   | MMMM D, YYYY              | August 16, 2018                   |
+| `LLL`  | MMMM D, YYYY h:mm A       | August 16, 2018 8:02 PM           |
+| `LLLL` | dddd, MMMM D, YYYY h:mm A | Thursday, August 16, 2018 8:02 PM |
+
 ### RelativeTime
  - RelativeTime은 `.from`, `.to`, `.fromNow`, `.toNow` API를 추가하여 날짜를 상대 시간 문자열(예: 3 시간전) 으로 표시합니다.
 
@@ -145,17 +167,6 @@ List of added formats:
 | `BBBB` | 2561             | Full BE Year (Year + 543)             |
 | `BB`   | 61               | 2-digit of BE Year                    |
 
-### WeekOfYear
- - WeekOfYear은 `.week()` API를 추가하여 `Dayjs`의 년의 주를 `number`로 반환 합니다.
-
-```javascript
-import weekOfYear from 'dayjs/plugin/weekOfYear'
-
-dayjs.extend(weekOfYear)
-
-dayjs('06/27/2018').week() // 26
-```
-
 ### IsSameOrAfter
  - IsSameOrAfter는 `.isSameOrAfter()` API를 추가하여 날짜가 다른 날짜와 같거나 나중일 경우 `boolean`으로 값을 반환합니다.
 
@@ -189,6 +200,29 @@ dayjs.extend(isBetween)
 dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25'), 'year');
 ```
 
+### DayOfYear
+
+- DayOfYear adds `.dayOfYear()` API to returns a `number` indicating the `Dayjs`'s day of the year.
+
+```javascript
+import dayOfYear from "dayjs/plugin/dayOfYear";
+
+dayjs.extend(dayOfYear);
+
+dayjs("2010-01-01").dayOfYear(); // 1
+```
+
+### WeekOfYear
+ - WeekOfYear은 `.week()` API를 추가하여 `Dayjs`의 년의 주를 `number`로 반환 합니다.
+
+```javascript
+import weekOfYear from 'dayjs/plugin/weekOfYear'
+
+dayjs.extend(weekOfYear)
+
+dayjs('06/27/2018').week() // 26
+```
+
 ### QuarterOfYear
 - QuarterOfYear add `.quarter()` API to return to which quarter of the year belongs a date
 
diff --git a/docs/pt-br/Plugin.md b/docs/pt-br/Plugin.md
index 45fb31567..abc0ca9de 100644
--- a/docs/pt-br/Plugin.md
+++ b/docs/pt-br/Plugin.md
@@ -65,6 +65,28 @@ Lista de formatos adicionados:
 | `X`     | 1360013296       | Unix Timestamp em segundos            |
 | `x`     | 1360013296123    | Unix Timestamp em milissegundos       |
 
+### LocalizedFormat
+ - LocalizedFormat extends `dayjs().format` API to supply localized format options.
+
+```javascript
+import LocalizedFormat from 'dayjs/plugin/localizedFormat'
+
+dayjs.extend(LocalizedFormat)
+
+dayjs().format('L LT')
+```
+
+List of added formats:
+
+| Format | English Locale            | Sample Output                     |
+| ------ | ------------------------- | --------------------------------- |
+| `LT`   | h:mm A                    | 8:02 PM                           |
+| `LTS`  | h:mm:ss A                 | 8:02:18 PM                        |
+| `L`    | MM/DD/YYYY                | 08/16/2018                        |
+| `LL`   | MMMM D, YYYY              | August 16, 2018                   |
+| `LLL`  | MMMM D, YYYY h:mm A       | August 16, 2018 8:02 PM           |
+| `LLLL` | dddd, MMMM D, YYYY h:mm A | Thursday, August 16, 2018 8:02 PM |
+
 ### RelativeTime
  - RelativeTime adds `.from` `.to` `.fromNow` `.toNow` APIs to formats date to relative time strings (e.g. 3 hours ago).
 
@@ -144,17 +166,6 @@ Lista de formatos adicionados:
 | `BBBB`  | 2561             | Full BE Year (Year + 543)             |
 | `BB`    | 61               | 2-digit of BE Year                    |
 
-### WeekOfYear
- - WeekOfYear adiciona `.week()` à API para retornar um `number` indicando um objeto `Dayjs` com a semana do ano..
-
-```javascript
-import weekOfYear from 'dayjs/plugin/weekOfYear'
-
-dayjs.extend(weekOfYear)
-
-dayjs('06/27/2018').week() // 26
-```
-
 ### IsSameOrAfter
  - IsSameOrAfter adds `.isSameOrAfter()` API to returns a `boolean` indicating if a date is same of after another date.
 
@@ -187,6 +198,28 @@ dayjs.extend(isBetween)
 
 dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25'), 'year');
 ```
+### DayOfYear
+
+- DayOfYear adds `.dayOfYear()` API to returns a `number` indicating the `Dayjs`'s day of the year.
+
+```javascript
+import dayOfYear from "dayjs/plugin/dayOfYear";
+
+dayjs.extend(dayOfYear);
+
+dayjs("2010-01-01").dayOfYear(); // 1
+```
+
+### WeekOfYear
+ - WeekOfYear adiciona `.week()` à API para retornar um `number` indicando um objeto `Dayjs` com a semana do ano..
+
+```javascript
+import weekOfYear from 'dayjs/plugin/weekOfYear'
+
+dayjs.extend(weekOfYear)
+
+dayjs('06/27/2018').week() // 26
+```
 
 ### QuarterOfYear
 - QuarterOfYear add `.quarter()` API to return to which quarter of the year belongs a date
diff --git a/docs/zh-cn/Plugin.md b/docs/zh-cn/Plugin.md
index b06741025..d42d3fbaa 100644
--- a/docs/zh-cn/Plugin.md
+++ b/docs/zh-cn/Plugin.md
@@ -65,6 +65,28 @@ dayjs().format('Q Do k kk X x')
 | `X`    | 1360013296       | 秒为单位的Unix时间戳                  |
 | `x`    | 1360013296123    | 毫秒单位的Unix时间戳                  |
 
+### LocalizedFormat
+ - LocalizedFormat 扩展了 `dayjs().format` API 以支持更多本地化的长日期格式.
+
+```javascript
+import LocalizedFormat from 'dayjs/plugin/localizedFormat'
+
+dayjs.extend(LocalizedFormat)
+
+dayjs().format('L LT')
+```
+
+扩展的模版列表:
+
+| 模版    | 格式                      | 输出                             |
+| ------ | ------------------------- | --------------------------------- |
+| `LT`   | h:mm A                    | 8:02 PM                           |
+| `LTS`  | h:mm:ss A                 | 8:02:18 PM                        |
+| `L`    | MM/DD/YYYY                | 08/16/2018                        |
+| `LL`   | MMMM D, YYYY              | August 16, 2018                   |
+| `LLL`  | MMMM D, YYYY h:mm A       | August 16, 2018 8:02 PM           |
+| `LLLL` | dddd, MMMM D, YYYY h:mm A | Thursday, August 16, 2018 8:02 PM |
+
 ### RelativeTime
  - RelativeTime 增加了 `.from` `.to` `.fromNow` `.toNow` 4个 API 来展示相对的时间 (e.g. 3 小时以前).
 
@@ -124,9 +146,9 @@ dayjs.extend(isLeapYear)
 dayjs('2000-01-01').isLeapYear(); // true
 ```
 
-### 佛历
+### BuddhistEra
 - BuddhistEra 扩展了 `dayjs().format` API 以支持佛历格式化.
-- 佛教时代是一个年份编号系统,主要用于柬埔寨、老挝、缅甸和泰国等东南亚国家以及斯里兰卡、马来西亚和新加坡的中国人,用于宗教或官方场合([Wikipedia](https://en.wikipedia.org/wiki/Buddhist_calendar))
+- 佛历是一个年份编号系统,主要用于柬埔寨、老挝、缅甸和泰国等东南亚国家以及斯里兰卡、马来西亚和新加坡的中国人,用于宗教或官方场合([Wikipedia](https://en.wikipedia.org/wiki/Buddhist_calendar))
 - 要计算BE年,只需在年份中添加543。 例如,1977年5月26日AD / CE应显示为2520年5月26日BE(1977 + 543)
 
 ```javascript
@@ -144,17 +166,6 @@ List of added formats:
 | `BBBB` | 2561             | Full BE Year (Year + 543)             |
 | `BB`   | 61               | 2-digit of BE Year                    |
 
-### WeekOfYear
- - WeekOfYear 增加了 `.week()` API 返回一个 `number` 来表示 `Dayjs` 的日期是年中第几周.
-
-```javascript
-import weekOfYear from 'dayjs/plugin/weekOfYear'
-
-dayjs.extend(weekOfYear)
-
-dayjs('06/27/2018').week() // 26
-```
-
 ### IsSameOrAfter
  - IsSameOrAfter 增加了 `.isSameOrAfter()` API 返回一个 `boolean` 来展示一个时间是否和一个时间相同或在一个时间之后.
 
@@ -188,6 +199,29 @@ dayjs.extend(isBetween)
 dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25'), 'year');
 ```
 
+### DayOfYear
+
+- DayOfYear 增加了 `.dayOfYear()` API 返回一个 `number` 来表示 `Dayjs` 的日期是年中第几天。
+
+```javascript
+import dayOfYear from "dayjs/plugin/dayOfYear";
+
+dayjs.extend(dayOfYear);
+
+dayjs("2010-01-01").dayOfYear(); // 1
+```
+
+### WeekOfYear
+ - WeekOfYear 增加了 `.week()` API 返回一个 `number` 来表示 `Dayjs` 的日期是年中第几周.
+
+```javascript
+import weekOfYear from 'dayjs/plugin/weekOfYear'
+
+dayjs.extend(weekOfYear)
+
+dayjs('06/27/2018').week() // 26
+```
+
 ### QuarterOfYear
 - QuarterOfYear 增加了 `.quarter()` API `number` 来表示 `Dayjs` 的日期是第几个季度.
 

From 7e65482469c78541e4f21668dd8c9b9adb527d0e Mon Sep 17 00:00:00 2001
From: iamkun <kunhello@outlook.com>
Date: Sat, 2 Feb 2019 15:44:50 +0800
Subject: [PATCH 11/11] docs: update dayofyear doc

---
 docs/en/Plugin.md    | 3 ++-
 docs/es-es/Plugin.md | 3 ++-
 docs/ja/Plugin.md    | 3 ++-
 docs/ko/Plugin.md    | 3 ++-
 docs/pt-br/Plugin.md | 3 ++-
 docs/zh-cn/Plugin.md | 3 ++-
 6 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/docs/en/Plugin.md b/docs/en/Plugin.md
index 654898090..2b46d536b 100644
--- a/docs/en/Plugin.md
+++ b/docs/en/Plugin.md
@@ -209,7 +209,7 @@ dayjs("2010-10-20").isBetween("2010-10-19", dayjs("2010-10-25"), "year");
 
 ### DayOfYear
 
-- DayOfYear adds `.dayOfYear()` API to returns a `number` indicating the `Dayjs`'s day of the year.
+- DayOfYear adds `.dayOfYear()` API to returns a `number` indicating the `Dayjs`'s day of the year, or to set the day of the year.
 
 ```javascript
 import dayOfYear from "dayjs/plugin/dayOfYear";
@@ -217,6 +217,7 @@ import dayOfYear from "dayjs/plugin/dayOfYear";
 dayjs.extend(dayOfYear);
 
 dayjs("2010-01-01").dayOfYear(); // 1
+dayjs("2010-01-01").dayOfYear(365); // 2010-12-31
 ```
 
 ### WeekOfYear
diff --git a/docs/es-es/Plugin.md b/docs/es-es/Plugin.md
index 5260cc019..47b7ab26c 100644
--- a/docs/es-es/Plugin.md
+++ b/docs/es-es/Plugin.md
@@ -209,7 +209,7 @@ dayjs("2010-10-20").isBetween("2010-10-19", dayjs("2010-10-25"), "year");
 
 ### DayOfYear
 
-- DayOfYear añade a la API `.dayOfYear()`, que devuelve un dato de tipo `number` indicando el día del año correspondiente a la fecha del objeto `Dayjs`.
+- DayOfYear añade a la API `.dayOfYear()`, que devuelve un dato de tipo `number` indicando el día del año correspondiente a la fecha del objeto `Dayjs`, or to set the day of the year.
 
 ```javascript
 import dayOfYear from "dayjs/plugin/dayOfYear";
@@ -217,6 +217,7 @@ import dayOfYear from "dayjs/plugin/dayOfYear";
 dayjs.extend(dayOfYear);
 
 dayjs("2018-01-01").week(); // 1
+dayjs("2010-01-01").dayOfYear(365); // 2010-12-31
 ```
 
 ### WeekOfYear
diff --git a/docs/ja/Plugin.md b/docs/ja/Plugin.md
index d86b95945..e05bcb220 100644
--- a/docs/ja/Plugin.md
+++ b/docs/ja/Plugin.md
@@ -210,7 +210,7 @@ dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25'), 'year');
 ```
 ### DayOfYear
 
-- DayOfYear adds `.dayOfYear()` API to returns a `number` indicating the `Dayjs`'s day of the year.
+- DayOfYear adds `.dayOfYear()` API to returns a `number` indicating the `Dayjs`'s day of the year, or to set the day of the year.
 
 ```javascript
 import dayOfYear from "dayjs/plugin/dayOfYear";
@@ -218,6 +218,7 @@ import dayOfYear from "dayjs/plugin/dayOfYear";
 dayjs.extend(dayOfYear);
 
 dayjs("2010-01-01").dayOfYear(); // 1
+dayjs("2010-01-01").dayOfYear(365); // 2010-12-31
 ```
 
 ### WeekOfYear
diff --git a/docs/ko/Plugin.md b/docs/ko/Plugin.md
index 641567ef0..5d25e94e0 100644
--- a/docs/ko/Plugin.md
+++ b/docs/ko/Plugin.md
@@ -202,7 +202,7 @@ dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25'), 'year');
 
 ### DayOfYear
 
-- DayOfYear adds `.dayOfYear()` API to returns a `number` indicating the `Dayjs`'s day of the year.
+- DayOfYear adds `.dayOfYear()` API to returns a `number` indicating the `Dayjs`'s day of the year, or to set the day of the year.
 
 ```javascript
 import dayOfYear from "dayjs/plugin/dayOfYear";
@@ -210,6 +210,7 @@ import dayOfYear from "dayjs/plugin/dayOfYear";
 dayjs.extend(dayOfYear);
 
 dayjs("2010-01-01").dayOfYear(); // 1
+dayjs("2010-01-01").dayOfYear(365); // 2010-12-31
 ```
 
 ### WeekOfYear
diff --git a/docs/pt-br/Plugin.md b/docs/pt-br/Plugin.md
index abc0ca9de..1b3db19c5 100644
--- a/docs/pt-br/Plugin.md
+++ b/docs/pt-br/Plugin.md
@@ -200,7 +200,7 @@ dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25'), 'year');
 ```
 ### DayOfYear
 
-- DayOfYear adds `.dayOfYear()` API to returns a `number` indicating the `Dayjs`'s day of the year.
+- DayOfYear adds `.dayOfYear()` API to returns a `number` indicating the `Dayjs`'s day of the year, or to set the day of the year.
 
 ```javascript
 import dayOfYear from "dayjs/plugin/dayOfYear";
@@ -208,6 +208,7 @@ import dayOfYear from "dayjs/plugin/dayOfYear";
 dayjs.extend(dayOfYear);
 
 dayjs("2010-01-01").dayOfYear(); // 1
+dayjs("2010-01-01").dayOfYear(365); // 2010-12-31
 ```
 
 ### WeekOfYear
diff --git a/docs/zh-cn/Plugin.md b/docs/zh-cn/Plugin.md
index d42d3fbaa..0bf10ea98 100644
--- a/docs/zh-cn/Plugin.md
+++ b/docs/zh-cn/Plugin.md
@@ -201,7 +201,7 @@ dayjs('2010-10-20').isBetween('2010-10-19', dayjs('2010-10-25'), 'year');
 
 ### DayOfYear
 
-- DayOfYear 增加了 `.dayOfYear()` API 返回一个 `number` 来表示 `Dayjs` 的日期是年中第几天。
+- DayOfYear 增加了 `.dayOfYear()` API 返回一个 `number` 来表示 `Dayjs` 的日期是年中第几天,或设置成是年中第几天。
 
 ```javascript
 import dayOfYear from "dayjs/plugin/dayOfYear";
@@ -209,6 +209,7 @@ import dayOfYear from "dayjs/plugin/dayOfYear";
 dayjs.extend(dayOfYear);
 
 dayjs("2010-01-01").dayOfYear(); // 1
+dayjs("2010-01-01").dayOfYear(365); // 2010-12-31
 ```
 
 ### WeekOfYear