Expand description
Persian month/weekday names, numeral conversion, and month parsing. Persian calendar data: month names, weekday names, and numeral conversion.
Provides both Persian script and romanized forms for all calendar labels, plus a parser that accepts either form as input.
Constants§
- MONTH_
DAYS - Number of days in each month (index 0 = Farvardin).
Months 1–6 have 31 days, months 7–11 have 30 days, month 12 has 29
(or 30 in leap years, handled by
shahanshahi::days_in_month). - MONTH_
NAMES - Month names in Persian script (Farvardin through Esfand).
- MONTH_
NAMES_ ROMANIZED - Month names in romanized form (lowercase), used as default display and for parsing user input.
- WEEKDAY_
NAMES_ EN - Short weekday names in English (Saturday to Friday)
- WEEKDAY_
NAMES_ FA - Short weekday names in Persian (Saturday to Friday).
Prefixed with U+200E (LTR mark) to prevent terminal
BiDireordering.
Functions§
- parse_
month - Parse a month string into a 1-based month index (1–12).
- to_
persian_ digits - Replace all ASCII digits (0–9) in a string with their Persian equivalents (۰–۹).