feat: add Jalali (Persian/Shamsi) calendar support with Saturday as week start#490
Open
hamedf62 wants to merge 4 commits into
Open
feat: add Jalali (Persian/Shamsi) calendar support with Saturday as week start#490hamedf62 wants to merge 4 commits into
hamedf62 wants to merge 4 commits into
Conversation
…eek start - Add jalaali-js library for Gregorian ↔ Jalali date conversion - Create lib/jalali-utils.ts with Jalali calendar utilities - Create hooks/use-calendar-locale.ts for unified calendar locale handling - Expand FirstDayOfWeek type to include 6 (Saturday) - Update all calendar views (month, week, day, mini, toolbar) to support Jalali calendar display and Saturday-first week ordering - Add Jalali month names (Farvardin … Esfand) to all locale files - Add Persian (fa) locale with full translations - Update settings UI to include Saturday as first day of week option - Update useFormatEventDate to show Jalali dates when locale is fa - Auto-detect Jalali calendar when fa locale is active The calendar system automatically switches to Jalali when the locale is set to Persian (fa). All internal date handling remains Gregorian (ISO 8601) for JMAP protocol compatibility; Jalali conversion is purely at the display layer.
Contributor
|
Ahalan wasahalan :-) |
Contributor
Author
|
Alaikum Salam |
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.
Description
This PR adds Jalali (Persian/Shamsi) calendar support and Saturday as first day of week to Bulwark Webmail.
What is the Jalali calendar?
The Jalali (also known as Persian or Shamsi) calendar is the official calendar of Iran and Afghanistan. It's a solar calendar with 12 months (Farvardin through Esfand) and is one of the most accurate calendar systems in use today. The week in Iran starts on Saturday (شنبه).
Key Features
fa(Persian/Farsi), the calendar automatically displays Jalali months and datesFirstDayOfWeeksetting now supports Saturday (6) alongside Sunday (0) and Monday (1)fatranslations for the entire UIChanges
New Files
lib/jalali-utils.ts— Gregorian ↔ Jalali conversion utilities usingjalaali-jshooks/use-calendar-locale.ts— Unified calendar locale hook abstracting Gregorian/Jalali differenceslocales/fa/common.json— Full Persian (Farsi) locale with ~3200 translationsModified Files
stores/settings-store.tsFirstDayOfWeektype expanded to0 | 1 | 6components/settings/language-settings.tsxcomponents/calendar/calendar-month-view.tsxuseCalendarLocalefor Jalali-aware renderingcomponents/calendar/calendar-week-view.tsxweekStartsOn: 6components/calendar/mini-calendar.tsxcomponents/calendar/calendar-toolbar.tsxhooks/use-format-event-date.tsfalocalepackage.jsonjalaali-jsdependencylocales/*/common.jsonHow It Works
Testing
falocaleKnown Interactions
settings.templates.image_too_largeto all 19 existing locale files. Ourfalocale already includes this key with a Persian translation. The 19 shared locale files will have a trivial 2-line merge conflict if both PRs merge around the same time — the resolution is to apply both additions.Notes for Reviewers
falocale file is included as a new addition to support Persian language usersjalaali-jsis a lightweight (no dependencies), well-maintained library for calendar conversionuseCalendarLocale) keeps the calendar system abstraction clean and makes it easy to add support for other non-Gregorian calendars in the future