mirror of
https://github.com/0x5eal/chrono-lc.git
synced 2024-12-13 05:20:37 +00:00
chore(docs): remove usage of deprecated methods
This commit is contained in:
parent
aa1befecb3
commit
2a7ebcc019
2 changed files with 14 additions and 4 deletions
|
@ -25,7 +25,13 @@ Please see ['chrono`'s documentation](https://docs.rs/chrono/).
|
|||
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);
|
||||
let dt = FixedOffset::east_opt(34200)
|
||||
.unwrap()
|
||||
.with_ymd_and_hms(2001, 7, 8, 0, 34, 59)
|
||||
.unwrap()
|
||||
.with_nanosecond(1_026_490_708)
|
||||
.unwrap();
|
||||
|
||||
println!("{}", dt.formatl("%c", "fr"));
|
||||
```
|
||||
|
||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -27,12 +27,16 @@
|
|||
//! To format a chrono `Date` or `DateTime` object, you can use the `formatl` method:
|
||||
//!
|
||||
//! ```rust
|
||||
//! # extern crate chrono;
|
||||
//! # extern crate chrono_locale;
|
||||
//! # use chrono::prelude::*;
|
||||
//! # use chrono_locale::LocaleDate;
|
||||
//!
|
||||
//! let dt = FixedOffset::east(34200).ymd(2001, 7, 8).and_hms_nano(0, 34, 59, 1_026_490_708);
|
||||
//! let dt = FixedOffset::east_opt(34200)
|
||||
//! .unwrap()
|
||||
//! .with_ymd_and_hms(2001, 7, 8, 0, 34, 59)
|
||||
//! .unwrap()
|
||||
//! .with_nanosecond(1_026_490_708)
|
||||
//! .unwrap();
|
||||
//!
|
||||
//! println!("{}", dt.formatl("%c", "fr"));
|
||||
//! ```
|
||||
//!
|
||||
|
|
Loading…
Reference in a new issue