1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// ~/src/constants.rs
//
// * Copyright (C) ParsiCore (parsidate) 2024-2025 <parsicore.dev@gmail.com>
// * Package : parsidate
// * License : Apache-2.0
// * Version : 1.7.1
// * URL : https://github.com/parsicore/parsidate
// * Sign: parsidate-20250607-fea13e856dcd-459c6e73c83e49e10162ee28b26ac7cd
//
//! # Library Constants
//!
//! This module centralizes constant definitions used throughout the `parsidate` library.
//! It includes fundamental values such as the supported date range, as well as internal
//! helper constants for names of months, weekdays, and seasons.
//!
//! Centralizing these values ensures consistency, simplifies maintenance, and clarifies
//! the library's operational boundaries and conventions.
use crateParsiDate;
// --- Public Constants ---
/// The minimum supported `ParsiDate`: Year 1, Month 1 (Farvardin), Day 1.
///
/// This constant defines the lower boundary for all date operations within the library.
/// It represents the epoch start of the Persian (Jalali) calendar, which corresponds
/// to the Gregorian date March 21, 622 CE in the proleptic Gregorian calendar.
///
/// # Examples
///
/// ```rust
/// use parsidate::{ParsiDate, MIN_PARSI_DATE};
///
/// let first_day_ever = ParsiDate::new(1, 1, 1).unwrap();
/// assert_eq!(first_day_ever, MIN_PARSI_DATE);
///
/// // Any attempt to create a date before this will fail.
/// assert!(ParsiDate::new(0, 12, 29).is_err());
/// ```
pub const MIN_PARSI_DATE: ParsiDate = ParsiDate ;
/// The maximum supported `ParsiDate`: Year 9999, Month 12 (Esfand), Day 29.
///
/// This constant defines the upper boundary for all date operations. The year 9999
/// is chosen as a practical upper limit for the library.
///
/// According to the 33-year cycle algorithm used for leap year calculations in this library,
/// the year 9999 is a common (non-leap) year (`9999 % 33 == 3`), and therefore its final
/// month, Esfand, contains 29 days.
///
/// # Examples
///
/// ```rust
/// use parsidate::{ParsiDate, MAX_PARSI_DATE};
///
/// let last_supported_day = ParsiDate::new(9999, 12, 29).unwrap();
/// assert_eq!(last_supported_day, MAX_PARSI_DATE);
///
/// // Any attempt to create a date after this will fail.
/// assert!(ParsiDate::new(10000, 1, 1).is_err());
///
/// // The 30th of Esfand in year 9999 is invalid.
/// assert!(ParsiDate::new(9999, 12, 30).is_err());
/// ```
pub const MAX_PARSI_DATE: ParsiDate = ParsiDate ;
// --- Internal Helper Constants ---
/// An array of Persian month names, indexed from 0.
///
/// This is used internally for formatting dates, specifically for the `%B` format specifier
/// in methods like [`ParsiDate::format_strftime`] and [`ParsiDateTime::format`].
///
/// - `index 0`: "فروردین" (Farvardin)
/// - `index 1`: "اردیبهشت" (Ordibehesht)
/// - ...
/// - `index 11`: "اسفند" (Esfand)
pub const MONTH_NAMES_PERSIAN: = ;
/// An array of Persian weekday names, indexed from 0, starting with Saturday.
///
/// This is used internally for formatting dates, specifically for the `%A` format specifier.
/// The indexing follows the convention where Saturday is the beginning of the week.
///
/// - `index 0`: "شنبه" (Shanbeh / Saturday)
/// - `index 1`: "یکشنبه" (Yekshanbeh / Sunday)
/// - ...
/// - `index 6`: "جمعه" (Jomeh / Friday)
pub const WEEKDAY_NAMES_PERSIAN: = ;
/// An array of Persian season names, indexed from 0.
///
/// This is used internally by the [`Season`](crate::season::Season) enum to provide string representations,
/// for example, via the `%K` format specifier.
///
/// - `index 0`: "بهار" (Bahar / Spring)
/// - `index 1`: "تابستان" (Tabestan / Summer)
/// - `index 2`: "پاییز" (Paeez / Autumn)
/// - `index 3`: "زمستان" (Zemestan / Winter)
pub const SEASON_NAMES_PERSIAN: = ;
/// An array of English season names, corresponding to the Persian seasons.
///
/// This is used internally by the [`Season`](crate::season::Season) enum to provide English
/// string representations. The order matches `SEASON_NAMES_PERSIAN`.
///
/// - `index 0`: "Spring"
/// - `index 1`: "Summer"
/// - `index 2`: "Autumn"
/// - `index 3`: "Winter"
pub const SEASON_NAMES_ENGLISH: = ;