Repository: iamkun/dayjs (JavaScript)

Issue:
dayOfYear produces incorrect results 
**Describe the bug**
dayOfYear produces incorrect results 

My config dayjs

```js
import dayjs from 'dayjs';
import ru from 'dayjs/locale/ru';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import badMutable from 'dayjs/plugin/badMutable';
import quarterOfYear from 'dayjs/plugin/quarterOfYear';
import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
import isBetween from 'dayjs/plugin/isBetween';
import isSameOrAfter from 'dayjs/plugin/isSameOrAfter';
import dayOfYear from 'dayjs/plugin/dayOfYear';
import utc from 'dayjs/plugin/utc';
import relativeTime from 'dayjs/plugin/relativeTime';

dayjs.locale(ru);
dayjs.extend(customParseFormat);
dayjs.extend(badMutable);
dayjs.extend(quarterOfYear);
dayjs.extend(isSameOrBefore);
dayjs.extend(isBetween);
dayjs.extend(isSameOrAfter);
dayjs.extend(dayOfYear);
dayjs.extend(utc);
dayjs.extend(relativeTime);

export default dayjs;
```

Execution jest test
```bash
> 461 |         expect(dayjs(`09.04.2020`, `DD.MM.YYYY`).dayOfYear()).toEqual(100);
```

**Expected behavior**
Expected: 100
Received: 1

**Information**
 - Day.js Version 1.10.4
 - OS: Windows 10
 - Time zone: [e.g. GMT+04:00 DST (Moscow)]



Discussion:
:tada: This issue has been resolved in version 1.10.6 :tada:

The release is available on:
- [npm package (@latest dist-tag)](https://www.npmjs.com/package/dayjs/v/1.10.6)
- [GitHub release](https://github.com/iamkun/dayjs/releases/tag/v1.10.6)

Your **[semantic-release](https://github.com/semantic-release/semantic-release)** bot :package::rocket:



Patch:
diff --git a/src/plugin/dayOfYear/index.js b/src/plugin/dayOfYear/index.js
index 018ef3396..f4960da6e 100644
--- a/src/plugin/dayOfYear/index.js
+++ b/src/plugin/dayOfYear/index.js
@@ -1,7 +1,8 @@
-export default (o, c) => {
+export default (o, c, d) => {
   const proto = c.prototype
   proto.dayOfYear = function (input) {
-    const dayOfYear = Math.round((this.startOf('day') - this.startOf('year')) / 864e5) + 1
+    // d(this) is for badMutable
+    const dayOfYear = Math.round((d(this).startOf('day') - d(this).startOf('year')) / 864e5) + 1
     return input == null ? dayOfYear : this.add(input - dayOfYear, 'day')
   }
 }


Test patch:
diff --git a/test/plugin/badMutable.test.js b/test/plugin/badMutable.test.js
index bfd351520..b101af68c 100644
--- a/test/plugin/badMutable.test.js
+++ b/test/plugin/badMutable.test.js
@@ -2,10 +2,12 @@ import MockDate from 'mockdate'
 import moment from 'moment'
 import dayjs from '../../src'
 import badMutable from '../../src/plugin/badMutable'
+import dayOfYear from '../../src/plugin/dayOfYear'
 import weekOfYear from '../../src/plugin/weekOfYear'
 import '../../src/locale/zh-cn'
 
 dayjs.extend(badMutable)
+dayjs.extend(dayOfYear)
 dayjs.extend(weekOfYear)
 
 beforeEach(() => {
@@ -188,7 +190,14 @@ it('isAfter isBefore isSame', () => {
   expect(d.isAfter()).toBe(false)
 })
 
-it('WeekOfYear get week won"t change instance', () => {
+it('DayOfYear get day won\'t change instance', () => {
+  const d = dayjs()
+  const format = d.format()
+  d.dayOfYear()
+  expect(d.format()).toBe(format)
+})
+
+it('WeekOfYear get week won\'t change instance', () => {
   const d = dayjs()
   const format = d.format()
   d.week()