erajp

Crates.ioerajp
lib.rserajp
version0.3.0
sourcesrc
created_at2019-01-14 09:45:07.727699
updated_at2020-01-12 04:44:35.634035
descriptionJapanese era converter for Rust
homepage
repositoryhttps://github.com/thara/erajp
max_upload_size
id108480
size15,154
Tomochika Hara (thara)

documentation

README

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)

Commit count: 20

cargo fmt