chore: update docs

This commit is contained in:
Erica Marigold 2023-08-23 18:50:02 +05:30 committed by GitHub
parent f8599bf8ef
commit 6ba7a3bd04
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,25 +1,20 @@
# chrono-locale # chrono-locale
This crate allows to format [chrono](https://github.com/chronotope/chrono) dates with localized months and week days. This crate allows to format [chrono](https://github.com/chronotope/chrono) dates with localized months and week days. Backwards comptible fork of [Alex-PK/chrono-locale](https://github.com/Alex-PK/chrono-locale), now works with the latest version of chrono.
It's in early development and everything could change. Use with caution!
## Usage ## Usage
Put this in your Cargo.toml: Put this in your Cargo.toml:
``` ```toml
[dependencies] [dependencies]
chrono = "0.4" chrono = "0.4.56"
chrono_locale = "0.1" chrono_locale = { git = "https://github.com/0x5eal/chrono-locale.git", rev = "f8599bf" }
``` ```
Then put this in your `lib.rs` or `main.rs`: Then put this in your `lib.rs` or `main.rs`:
``` ```
extern crate chrono;
extern crate chrono_locale;
use chrono::prelude::*; use chrono::prelude::*;
use chrono_locale::LocaleDate; use chrono_locale::LocaleDate;
``` ```
@ -34,5 +29,5 @@ let dt = FixedOffset::east(34200).ymd(2001, 7, 8).and_hms_nano(0, 34, 59, 1_026_
println!("{}", dt.formatl("%c", "fr")); println!("{}", dt.formatl("%c", "fr"));
``` ```
All of [chrono's formatting placeholders](https://docs.rs/chrono/0.4.6/chrono/format/strftime/index.html) All of [chrono's formatting placeholders](https://docs.rs/chrono/0.4.56/chrono/format/strftime/index.html)
work except for `%3f`, `%6f` and `%9f` (but `%.3f`, `%.6f` and `%.9f` work normally) work except for `%3f`, `%6f` and `%9f` (but `%.3f`, `%.6f` and `%.9f` work normally)