pub struct Indian;Expand description
The Indian National (Śaka) Calendar
The Indian National calendar is a solar calendar created by the Indian government.
This implementation extends proleptically for dates before the calendar’s creation in 1879 Śaka (1957 CE).
This corresponds to the "indian" CLDR calendar.
§Era codes
This calendar uses a single era code: shaka, with Śaka 0 being 78 CE. Dates before this era use negative years.
§Months and days
The 12 months are called Chaitra (M01, 30 days), Vaisakha (M02, 31 days),
Jyaishtha (M03, 31 days), Ashadha (M04, 31 days), Sravana (M05, 31 days),
Bhadra (M06, 31 days), Asvina (M07, 30 days), Kartika (M08, 30 days),
Agrahayana or Margasirsha (M09, 30 days), Pausha (M10, 30 days), Magha (M11, 30 days),
Phalguna (M12, 30 days).
In leap years (years where the concurrent Gregorian year (year + 78) is leap),
Chaitra gains a 31st day.
Standard years thus have 365 days, and leap years 366.
§Calendar drift
The Indian calendar has the same year lengths and leap year rules as the Gregorian calendar, so it experiences the same drift of 1 day in ~7700 years with respect to the seasons.
Implementations§
Trait Implementations§
Source§impl Calendar for Indian
impl Calendar for Indian
Source§type DifferenceError = Infallible
type DifferenceError = Infallible
untilSource§fn from_codes(
&self,
era: Option<&str>,
year: i32,
month_code: MonthCode,
day: u8,
) -> Result<<Indian as Calendar>::DateInner, DateError>
fn from_codes( &self, era: Option<&str>, year: i32, month_code: MonthCode, day: u8, ) -> Result<<Indian as Calendar>::DateInner, DateError>
Source§fn from_rata_die(&self, rd: RataDie) -> <Indian as Calendar>::DateInner
fn from_rata_die(&self, rd: RataDie) -> <Indian as Calendar>::DateInner
RataDieSource§fn to_rata_die(&self, date: &<Indian as Calendar>::DateInner) -> RataDie
fn to_rata_die(&self, date: &<Indian as Calendar>::DateInner) -> RataDie
RataDie from this dateSource§fn has_cheap_iso_conversion(&self) -> bool
fn has_cheap_iso_conversion(&self) -> bool
from_iso/to_iso is more efficient
than from_rata_die/to_rata_die.Source§fn months_in_year(&self, date: &<Indian as Calendar>::DateInner) -> u8
fn months_in_year(&self, date: &<Indian as Calendar>::DateInner) -> u8
Source§fn days_in_year(&self, date: &<Indian as Calendar>::DateInner) -> u16
fn days_in_year(&self, date: &<Indian as Calendar>::DateInner) -> u16
Source§fn days_in_month(&self, date: &<Indian as Calendar>::DateInner) -> u8
fn days_in_month(&self, date: &<Indian as Calendar>::DateInner) -> u8
Source§fn year_info(
&self,
date: &<Indian as Calendar>::DateInner,
) -> <Indian as Calendar>::Year
fn year_info( &self, date: &<Indian as Calendar>::DateInner, ) -> <Indian as Calendar>::Year
Source§fn is_in_leap_year(&self, date: &<Indian as Calendar>::DateInner) -> bool
fn is_in_leap_year(&self, date: &<Indian as Calendar>::DateInner) -> bool
Source§fn month(&self, date: &<Indian as Calendar>::DateInner) -> MonthInfo
fn month(&self, date: &<Indian as Calendar>::DateInner) -> MonthInfo
dateSource§fn day_of_month(&self, date: &<Indian as Calendar>::DateInner) -> DayOfMonth
fn day_of_month(&self, date: &<Indian as Calendar>::DateInner) -> DayOfMonth
dateSource§fn day_of_year(&self, date: &<Indian as Calendar>::DateInner) -> DayOfYear
fn day_of_year(&self, date: &<Indian as Calendar>::DateInner) -> DayOfYear
Source§fn debug_name(&self) -> &'static str
fn debug_name(&self) -> &'static str
Source§fn calendar_algorithm(&self) -> Option<CalendarAlgorithm>
fn calendar_algorithm(&self) -> Option<CalendarAlgorithm>
CalendarAlgorithm that is required to match
when parsing into this calendar. Read moreSource§fn from_iso(&self, iso: IsoDateInner) -> Self::DateInner
fn from_iso(&self, iso: IsoDateInner) -> Self::DateInner
Source§fn to_iso(&self, date: &Self::DateInner) -> IsoDateInner
fn to_iso(&self, date: &Self::DateInner) -> IsoDateInner
Source§fn extended_year(&self, date: &Self::DateInner) -> i32
fn extended_year(&self, date: &Self::DateInner) -> i32
Source§impl CldrCalendar for Indian
impl CldrCalendar for Indian
Source§type YearNamesV1 = DatetimeNamesYearIndianV1
type YearNamesV1 = DatetimeNamesYearIndianV1
Source§type MonthNamesV1 = DatetimeNamesMonthIndianV1
type MonthNamesV1 = DatetimeNamesMonthIndianV1
Source§type SkeletaV1 = DatetimePatternsDateIndianV1
type SkeletaV1 = DatetimePatternsDateIndianV1
Source§impl From<Indian> for AnyCalendar
impl From<Indian> for AnyCalendar
Source§fn from(value: Indian) -> AnyCalendar
fn from(value: Indian) -> AnyCalendar
Source§impl IntoAnyCalendar for Indian
impl IntoAnyCalendar for Indian
Source§fn to_any(self) -> AnyCalendar
fn to_any(self) -> AnyCalendar
AnyCalendar, moving it Read moreSource§fn kind(&self) -> AnyCalendarKind
fn kind(&self) -> AnyCalendarKind
AnyCalendarKind enum variant associated with this calendarSource§fn from_any(any: AnyCalendar) -> Result<Indian, AnyCalendar>
fn from_any(any: AnyCalendar) -> Result<Indian, AnyCalendar>
Source§fn from_any_ref(any: &AnyCalendar) -> Option<&Indian>
fn from_any_ref(any: &AnyCalendar) -> Option<&Indian>
Source§impl Ord for Indian
impl Ord for Indian
Source§impl PartialOrd for Indian
impl PartialOrd for Indian
impl Copy for Indian
impl Eq for Indian
impl IntoFormattableAnyCalendar for Indian
impl StructuralPartialEq for Indian
impl UnstableSealed for Indian
Auto Trait Implementations§
impl Freeze for Indian
impl RefUnwindSafe for Indian
impl Send for Indian
impl Sync for Indian
impl Unpin for Indian
impl UnwindSafe for Indian
Blanket Implementations§
Source§impl<C> AsCalendar for Cwhere
C: Calendar,
impl<C> AsCalendar for Cwhere
C: Calendar,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> GetField<T> for Twhere
T: Copy + UnstableSealed,
impl<T> GetField<T> for Twhere
T: Copy + UnstableSealed,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more