5 releases (3 stable)

2.0.0 Apr 5, 2026
1.1.0 Mar 25, 2023
1.0.0 Jan 6, 2017
0.1.1 Mar 31, 2016
0.1.0 Mar 30, 2016

#64 in Date and time

Download history 3266/week @ 2026-01-19 3846/week @ 2026-01-26 4379/week @ 2026-02-02 7060/week @ 2026-02-09 3444/week @ 2026-02-16 1544/week @ 2026-02-23 3361/week @ 2026-03-02 5971/week @ 2026-03-09 5878/week @ 2026-03-16 6426/week @ 2026-03-23 3844/week @ 2026-03-30 5445/week @ 2026-04-06 8743/week @ 2026-04-13 7072/week @ 2026-04-20 9232/week @ 2026-04-27 8082/week @ 2026-05-04

33,458 downloads per month
Used in 10 crates (7 directly)

MIT license

10KB
162 lines

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));
}

Dependencies

~0–1.4MB
~21K SLoC