feat: add narrow weekday format for Persian calendar#2895
Merged
Conversation
Use formatWeekdayName formatter to display narrow weekday names (single character) in Persian calendar, improving readability and consistency with Persian date formatting conventions.
Owner
|
Thanks @rezaaa for the suggestion. I added a test in |
gpbl
approved these changes
Feb 6, 2026
Contributor
Author
|
@gpbl Thank You, I guess I didn't get any contribution :)) |
Owner
Yes :) your name appears here: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add narrow weekday format for Persian calendar to align with common Persian date formatting standards.
Motivation
While integrating react-day-picker with shadcn components, I noticed that the Persian calendar was displaying short weekday names (e.g., two characters), which is inconsistent with the standard Persian date formatting convention. In Persian interfaces, weekday names are typically displayed in their narrow format (single character) for better readability and space efficiency.
Since shadcn is broadly used across many projects, this change ensures that the Persian calendar follows the more common and expected format that users are familiar with in Persian applications.
Current format
Standard and common format from popular persian websites
Changes
formatWeekdayNameformatter to the PersianDayPickercomponent"cccccc"(short format) to"ccccc"(narrow format)Thanks
Note
Low Risk
Localized formatting change scoped to weekday header rendering plus a small test addition; low risk outside of potential minor UI layout/translation differences.
Overview
Updates the Persian
DayPickerwrapper to overrideformatters.formatWeekdayName, rendering narrow weekday labels (ccccc) when the active locale is Persian (fa*) and keeping the default short format (cccccc) for other locales.Adds a regression test in
examples/PersianEn.test.tsxto ensure the English Jalali example still shows two-letter weekday headers (e.g., "Th").Written by Cursor Bugbot for commit cfc4373. This will update automatically on new commits. Configure here.