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

The year is not parsed correctly in Russian localization with CustomParseFormat #2743

Open
AgentRBY opened this issue Oct 8, 2024 · 0 comments

Comments

@AgentRBY
Copy link

AgentRBY commented Oct 8, 2024

Describe the bug
When a date is parsed from text starting from the month of December, the year is parsed as +1 to the year.

import dayjs from "dayjs";
import customParseFormat from 'dayjs/plugin/customParseFormat';
import "dayjs/locale/ru";

dayjs.extend(customParseFormat);

console.log(dayjs("01 декабря 2024", "DD MMMM YYYY", 'ru').year()); // 2025

Expected behavior
The year should be parsed correct:

console.log(dayjs("01 декабря 2024", "DD MMMM YYYY", 'ru').year()); // 2024 

Information

  • Day.js Version: 1.11.13
  • OS: Windows
  • Browser: Edge 129.0.2792.79
  • Time zone: GMT+3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant