nextui-org / nextui

🚀 Beautiful, fast and modern React UI library.
https://nextui.org
MIT License
21.42k stars 1.39k forks source link

[BUG] - DatePicker's showMonthAndYearPickers mode changes the calendar type on scrolling the year picker #3059

Closed Hasan-Mir closed 1 month ago

Hasan-Mir commented 3 months ago

NextUI Version

2.3.6

Describe the bug

When using a locale for the DatePicker component with the showMonthAndYearPickers enabled, the calendar locale changes while scrolling the years list.

locale="fa-IR":

import { DatePicker } from "@nextui-org/react";
import { I18nProvider } from "@react-aria/i18n";
import "./App.css";

function App() {
  return (
    <div>
      <I18nProvider locale="fa-IR">
        <DatePicker showMonthAndYearPickers />
      </I18nProvider>
    </div>
  );
}

https://github.com/nextui-org/nextui/assets/62181905/5a8d3fa7-cf3c-4b7a-affc-d0f4159e5dfc

locale="hi-IN-u-ca-indian":

function App() {
  return (
    <div>
      <I18nProvider locale="hi-IN-u-ca-indian">
        <DatePicker showMonthAndYearPickers />
      </I18nProvider>
    </div>
  );
}

https://github.com/nextui-org/nextui/assets/62181905/f6e85369-10dd-4293-9722-352c474aa188

Your Example Website or App

https://codesandbox.io/p/devbox/friendly-leftpad-g56gcc?file=%2FApp.tsx&utm_medium=sandpack

Steps to Reproduce the Bug or Issue

  1. Create a DatePicker and provide locale and showMonthAndYearPickers props.
  2. Open the month and year pickers and scroll the years list.

Expected behavior

It should not change the name of the months and the year from the selected locale to Gregorian.

Screenshots or Videos

No response

Operating System Version

Windows 10

Browser

Chrome

linear[bot] commented 3 months ago

ENG-877 [BUG] - DatePicker's showMonthAndYearPickers mode changes the calendar type on scrolling the year picker

MHBahrampour commented 2 months ago

Almost two month later using version 2.4.2 and the issue still persists.

wingkwong commented 2 months ago

@MHBahrampour The fix will be available in the upcoming release v2.4.3.

MHBahrampour commented 2 months ago

@wingkwong Thanks. I really need it for my new project.

abhirakshit commented 1 month ago

Following!

wingkwong commented 1 month ago

Closing - fixed in above PR. The fix will be available in the upcoming bug fix release v2.4.3.