Module calendrical_calculations::chinese_based

source Β·
Expand description

Chinese-like lunar calendars (Chinese, Dangi)

Structs§

Constants§

Traits§

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

Functions§

  • This function forces the RataDie to be on December 20, 21, 22, or 23. It was created for practical considerations and is not in the text.
  • Get a chinese based date from a fixed date, with the related ISO year
  • Returns the number of days in the given month after the given new_year. Also returns the RataDie of the new moon beginning the next month.
  • Given a new year, calculate the number of days in the previous year
  • Calculated the numbers of days in the given year
  • Given the new year and a month/day pair, calculate the number of days until the first day of the given month
  • Get a RataDie in the middle of a year.
  • Given that new_year is the first day of a leap year, find which month in the year is a leap month.
  • Whether this year is a leap year
  • The last month and day in this year
  • Get the current major solar term of a fixed date, output as an integer from 1..=12.
  • midnight πŸ”’
    Universal time of midnight at start of a Moment’s day at the observation location
  • Returns the number of days in the given (year, month).
  • Returns the length of each month in the year, as well as a leap month index (1-indexed) if any.
  • new_moon_before πŸ”’
    The fixed date in standard time at the observation location of the previous new moon before a given Moment.
  • The fixed date in standard time at the observation location of the next new moon on or after a given Moment.
  • new_year_in_sui πŸ”’
    Determines the fixed date of the lunar new year given the start of its corresponding solar year (ζ­²), which is also the winter solstice
  • Get the fixed date of the nearest Lunar New Year on or before a given fixed date. This function also returns the solstice following a given date for optimization (see #3743).
  • Get the fixed date of the nearest winter solstice, in the Chinese time zone, on or before a given fixed date.