Expand description
§Overview
Calculate the date of Easter Sunday in Gregorian/Julian calendar using the computus method.
§Features
Optional features:
- [
chrono][]: Enable directly producing achrono::NaiveDate - [
jiff][]: Enable directly producing ajiff::civil::Date
§Example
You can find when Easter is for a particular year with:
// For Gregorian calendars
let easter = computus::gregorian(2016).unwrap();
assert_eq!((easter.month, easter.day), (3, 27));
// For Julian calendars
let easter = computus::julian(2016).unwrap();
assert_eq!((easter.month, easter.day), (4, 18));
// With `chrono` feature
#[cfg(feature = "chrono")] {
use chrono::Datelike;
let easter = computus::gregorian_naive(2023).unwrap();
assert_eq!((easter.month(), easter.day()), (4, 9));
}
// With `jiff` feature
#[cfg(feature = "jiff")] {
use jiff::civil::Date;
let easter = computus::gregorian_jiff_date(2023).unwrap();
assert_eq!((easter.month(), easter.day()), (4, 9));
}