Skip to content

feat: add narrow weekday format for Persian calendar#2895

Merged
gpbl merged 3 commits intogpbl:mainfrom
rezaaa:feat/persian_weekday_enhancement
Feb 6, 2026
Merged

feat: add narrow weekday format for Persian calendar#2895
gpbl merged 3 commits intogpbl:mainfrom
rezaaa:feat/persian_weekday_enhancement

Conversation

@rezaaa
Copy link
Copy Markdown
Contributor

@rezaaa rezaaa commented Feb 6, 2026

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

image

Standard and common format from popular persian websites

image image

Changes

  • Added formatWeekdayName formatter to the Persian DayPicker component
  • Changed from the default "cccccc" (short format) to "ccccc" (narrow format)
  • This displays single-character weekday abbreviations (e.g., "ش" for Saturday) instead of two-character short names

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 DayPicker wrapper to override formatters.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.tsx to 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.

Use formatWeekdayName formatter to display narrow weekday names (single character) in Persian calendar, improving readability and consistency with Persian date formatting conventions.
@rezaaa rezaaa requested a review from gpbl as a code owner February 6, 2026 18:12
@gpbl
Copy link
Copy Markdown
Owner

gpbl commented Feb 6, 2026

Thanks @rezaaa for the suggestion. I added a test in cfc4373 (#2895) and limited the shorter format to the fa locales.

@gpbl gpbl merged commit 3caa733 into gpbl:main Feb 6, 2026
12 checks passed
@rezaaa
Copy link
Copy Markdown
Contributor Author

rezaaa commented Feb 6, 2026

@gpbl Thank You, I guess I didn't get any contribution :))

@gpbl
Copy link
Copy Markdown
Owner

gpbl commented Feb 6, 2026

@gpbl Thank You, I guess I didn't get any contribution :))

Yes :) your name appears here:
https://github.com/gpbl/react-day-picker/releases/tag/v9.13.1

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 this pull request may close these issues.

2 participants