Skip to content

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

@AgentRBY

Description

@AgentRBY

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions