Skip to content
Japanese era converter for Rust
Rust
Branch: master
Clone or download
Latest commit daae2d6 Apr 1, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Support 令和 Apr 1, 2019
.gitignore Initial commit Jan 13, 2019
Cargo.lock 🔧 Update Cargo.lock Apr 1, 2019
Cargo.toml 🔖 Bump version Apr 1, 2019
LICENSE Create LICENSE Jan 14, 2019
README.md Support 令和 Apr 1, 2019

README.md

erajp

Japanese era converter for Rust.

Inspired by mattn/go-erajp.

Examples

Convert a year to Japanese era.

assert_eq!(Some("令和"), erajp::to_era_from_year(2019));

Convert a day to Japanese era (using chrono)

extern crate chrono;
use chrono::prelude::*;

let today = Local::today();
assert_eq!(Some("平成"), erajp::to_era(&today));

License

MIT

Author

Tomochika Hara (a.k.a. thara)

You can’t perform that action at this time.