silk.time.calendar_data.

Tables of the calendars of silk.time.calendar that cannot be computed with a short rule.

When to use#

Use silk.time.calendar and not this module. The tables are public only because the calendar module reads them.

Details#

  • CHINESE_YEARS and DANGI_YEARS have one number for each year from 1800 to 2200. The year of the table is the ISO 8601 year in which the lunar year starts.

  • UMALQURA_MONTHS and UMALQURA_STARTS have the Umm al-Qura calendar of Saudi Arabia for the years 1300 to 1600 of the Hijra.

  • PERSIAN_EARLY_YEARS has the years of the Persian calendar that start one day earlier than the 33-year rule says.

Examples#

Read the first year of the Chinese table#

silk
import silk.time.calendar_data as CalendarData

pub fn main() -> i32 {
  // Bits 6 to 9 have the number of the month that is repeated, or 0. In 1800 it is month 4.
  let leap = (CalendarData.CHINESE_YEARS[0] / 64) % 16
  if leap != 4 {
    return 1
  }
  return 0
}

Import as CalendarData with import silk.time.calendar_data as CalendarData.

Public declarations: 7.

LUNAR_FIRST_YEAR#

silk
pub const LUNAR_FIRST_YEAR: i32

The first ISO 8601 year of CHINESE_YEARS and DANGI_YEARS.

UMALQURA_FIRST_YEAR#

silk
pub const UMALQURA_FIRST_YEAR: i32

The first year of the Hijra in UMALQURA_MONTHS and UMALQURA_STARTS.

CHINESE_YEARS#

silk
pub const CHINESE_YEARS: [i32; 401]

The years of the Chinese calendar from 1800 to 2200, one number for each year.

Details#

Bit 0 is the ISO month of the new year minus 1, bits 1 to 5 are its day minus 1, bits 6 to 9 are the number of the month that is repeated or 0, and bit 10 + n is 1 when month n + 1 of the year, counted from the new year, has 30 days and 0 when it has 29.

DANGI_YEARS#

silk
pub const DANGI_YEARS: [i32; 401]

The years of the Korean Dangi calendar from 1800 to 2200, one number for each year.

Details#

Bit 0 is the ISO month of the new year minus 1, bits 1 to 5 are its day minus 1, bits 6 to 9 are the number of the month that is repeated or 0, and bit 10 + n is 1 when month n + 1 of the year, counted from the new year, has 30 days and 0 when it has 29.

UMALQURA_MONTHS#

silk
pub const UMALQURA_MONTHS: [i32; 301]

The month lengths of the Umm al-Qura years 1300 to 1600: bit 12 - m is 1 when month m has 30 days and 0 when it has 29.

UMALQURA_STARTS#

silk
pub const UMALQURA_STARTS: [i32; 302]

The first day of the Umm al-Qura years 1300 to 1601, in days from the first day of year 1 of the Islamic civil calendar.

PERSIAN_EARLY_YEARS#

silk
pub const PERSIAN_EARLY_YEARS: [i32; 78]

The years of the Persian calendar, in rising order, that start one day earlier than the 33-year rule says, because the year before them does not have the leap day that the rule gives.

Category: Time.

Profiles: aarch64-apple-darwin, aarch64-unknown-linux-gnu, aarch64-unknown-linux-gnu-no-libc, x86_64-unknown-linux-gnu, x86_64-unknown-linux-gnu-no-libc, wasm32-unknown-unknown, wasm32-wasip1, wasm32-wasip2, x86_64-pc-windows-msvc, wasm64-unknown-unknown.

View the source of this page