pub trait ChineseBased {
    const EPOCH: RataDie;

    // Required method
    fn location(fixed: RataDie) -> Location;
}
Expand description

The trait ChineseBased is used by Chinese-based calendars to perform computations shared by such calendar. To do so, calendars should:

  • Implement fn location by providing a location at which observations of the moon are recorded, which may change over time (the zone is important, long, lat, and elevation are not relevant for these calculations)
  • Define const EPOCH as a RataDie marking the start date of the era of the Calendar for internal use, which may not accurately reflect how years or eras are marked traditionally or seen by end-users

Required Associated Constants§

source

const EPOCH: RataDie

The RataDie of the beginning of the epoch used for internal computation; this may not reflect traditional methods of year-tracking or eras, since Chinese-based calendars may not track years ordinally in the same way many western calendars do.

Required Methods§

source

fn location(fixed: RataDie) -> Location

Given a fixed date, return the location used for observations of the new moon in order to calculate the beginning of months. For multiple Chinese-based lunar calendars, this has changed over the years, and can cause differences in calendar date.

Implementors§

source§

impl ChineseBased for Chinese

source§

const EPOCH: RataDie = CHINESE_EPOCH

source§

impl ChineseBased for Dangi

source§

const EPOCH: RataDie = KOREAN_EPOCH