chrono_locale

Crates.iochrono_locale
lib.rschrono_locale
version0.1.1
sourcesrc
created_at2018-12-14 09:21:57.546716
updated_at2018-12-14 10:58:10.548478
descriptionLocalised date and time formatting library for Rust, based on chrono
homepagehttps://github.com/Alex-PK/chrono-locale
repositoryhttps://github.com/Alex-PK/chrono-locale
max_upload_size
id101864
size74,205
Alessandro Pellizzari (Alex-PK)

documentation

README

chrono-locale

This crate allows to format chrono dates with localized months and week days.

It's in early development and everything could change. Use with caution!

Usage

Put this in your Cargo.toml:

[dependencies]
chrono = "0.4"
chrono_locale = "0.1"

Then put this in your lib.rs or main.rs:

extern crate chrono;
extern crate chrono_locale;

use chrono::prelude::*;
use chrono_locale::LocaleDate;

You can choose to import just parts of chrono instead of the whole prelude. Please see 'chrono`'s documentation.

To format a chrono Date or DateTime object, you can use the formatl method:

let dt = FixedOffset::east(34200).ymd(2001, 7, 8).and_hms_nano(0, 34, 59, 1_026_490_708);
println!("{}", dt.formatl("%c", "fr"));

All of chrono's formatting placeholders work except for %3f, %6f and %9f (but %.3f, %.6f and %.9f work normally)

Commit count: 21

cargo fmt