nextui-org / nextui

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

[BUG] - DatePicker internationalization behavior #2842

Open alirezatayebinejad opened 2 months ago

alirezatayebinejad commented 2 months ago

NextUI Version

2.3.5

Describe the bug

when I add Persian language to the datepicker it works fine but when I open the year input and scroll down the years then the months suddenly turn back to the default locale instead of the persian months

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

just do this and open year and keep scroll down the years untill you see the months changes

Expected behavior

do not change the month and it should stay in the desire locale

Screenshots or Videos

No response

Operating System Version

windows 10

Browser

Chrome

linear[bot] commented 2 months ago

ENG-704 [BUG] - DatePicker internationalization behavior

wingkwong commented 2 months ago

Can you share your code or a stackblitz link?

alirezatayebinejad commented 2 months ago

Can you share your code or a stackblitz link?

import React from "react"; import {DatePicker} from "@nextui-org/react"; import {DateValue, now, parseAbsoluteToLocal} from "@internationalized/date"; import {I18nProvider} from "@react-aria/i18n";

export default function App() { let [date, setDate] = React.useState(parseAbsoluteToLocal("2021-04-07T18:45:22Z"));

return (

); }


just run this and open the year and month selection start scrolling the years while watching the month after scrolling you will see the month words changes to another months system , it happens for other locals like Persian 'fa-IR'
MhEsn commented 1 month ago

Hello there, I exactly faced this issue. Did you fine any solution for that?

wingkwong commented 1 week ago

Just an update. I'm working on it.