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

Reversed Next and Previous Button Behavior in Persian Locale (fa) with NextUI Calendar #4541

Open
sobhankh opened this issue Jan 12, 2025 · 4 comments · May be fixed by #4565
Open

Reversed Next and Previous Button Behavior in Persian Locale (fa) with NextUI Calendar #4541

sobhankh opened this issue Jan 12, 2025 · 4 comments · May be fixed by #4565
Assignees

Comments

@sobhankh
Copy link

NextUI Version

^2.6.11

Describe the bug

Here’s a clear and concise description of your issue in English for the GitHub issue tracker:

Issue:
In the NextUI Calendar component, when the language/locale is set to Persian (fa), the behavior of the nextButton and prevButton is reversed. The "Next" button navigates to the previous month, and the "Previous" button navigates to the next month. This issue seems to be related to the RTL (right-to-left) layout handling in Persian calendars.

Expected Behavior:
The nextButton should navigate to the next month, and the prevButton should navigate to the previous month, regardless of the locale or direction (RTL/LTR).

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

Steps to Reproduce the Bug or Issue:

  1. Set the locale of the Calendar component to fa (Persian).
  2. Render the Calendar in an RTL (right-to-left) layout.
  3. Attempt to navigate to the next or previous month using the nextButton and prevButton.
  4. Observe that the nextButton navigates to the previous month and the prevButton navigates to the next month.

This reversed behavior occurs specifically when the locale is set to Persian.

Expected behavior

Expected Behavior:
The nextButton should navigate to the next month, and the prevButton should navigate to the previous month, regardless of the locale or the RTL/LTR layout. This behavior should be consistent for all supported languages and layouts.

Screenshots or Videos

No response

Operating System Version

windows

Browser

Chrome

@MarufSharifi
Copy link

@wingkwong can you assign this to me?

@MarufSharifi
Copy link

@sobhankh can you please reproduce the issue using this link, Calendar component doesn't accept locale prop.

https://codesandbox.io/p/devbox/test-next-ui-ky6jhq

but yeah in a RTL layout it works reverse.

@sobhankh
Copy link
Author

In the fa-IR locale, the behavior of the calendar navigation buttons should be as follows:

The left arrow button must navigate to the previous month.
The right arrow button must navigate to the next month.
This is the standard behavior in Persian-language calendars. Currently, the behavior is reversed, which causes confusion for users.

https://codesandbox.io/p/devbox/test-next-ui-forked-hhrhdd?file=%2Fapp%2Fpage.tsx

@MarufSharifi MarufSharifi linked a pull request Jan 15, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants