1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Representation for jiff objects in human languages
//!
//! # Quick Start
//!
//! `HumanTime` objects are created from jiff objects, such as `jiff::DateTime`
//! and `jiff::Span`
//!
//! # Examples
//!
//! Convert current time taken as `now` to `HumanTime`
//!
//! ```
//! let dt = jiff::Zoned::now();
//! let ht = jiffy::HumanTime::from(dt);
//!
//! assert_eq!("now", format!("{}", ht));
//! ```
//!
//!
//! ```
//! let dt = jiff::Zoned::now().checked_sub(58.minutes()).unwrap()
//! let ht = jiffy::HumanTime::from(dt);
//!
//! assert_eq!("an hour ago", format!("{}", ht));
//! ```
//!
//! For full control over the text representation use `HumanTime::to_text_en()`
//!
//! ```
//! use jiff::ToSpan;;
//! use jiffy::{Accuracy, HumanTime, Tense};
//!
//! # fn main() {
//! let dt = 45.days();
//! let ht = HumanTime::from(dt);
//!
//! assert_eq!("a month", ht.to_text_en(Accuracy::Rough, Tense::Present));
//! assert_eq!("1 month, 2 weeks and 1 day", ht.to_text_en(Accuracy::Precise, Tense::Present));
//! # }
//! ```
pub use crate;
/// Present the object in human friendly text form