Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Computus

crates.io Documentation

Computus Easter calculation in Rust

Usage

Add this to your Cargo.toml:

[dependencies]
computus = "2.0.0"

You can find when Easter Sunday 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));
}

About

Computus Easter calculation in Rust

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages