Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dayOfYear produces incorrect results #1407

Closed
amstr1k opened this issue Mar 9, 2021 · 1 comment · Fixed by #1511
Closed

dayOfYear produces incorrect results #1407

amstr1k opened this issue Mar 9, 2021 · 1 comment · Fixed by #1511
Labels

Comments

@amstr1k
Copy link

amstr1k commented Mar 9, 2021

Describe the bug
dayOfYear produces incorrect results

My config dayjs

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

> 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)]
@iamkun
Copy link
Owner

iamkun commented Jul 6, 2021

🎉 This issue has been resolved in version 1.10.6 🎉

The release is available on:

Your semantic-release bot 📦🚀

@iamkun iamkun added the released label Jul 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants