Crate gedcomx_date
source ·Expand description
gedcomx-date-rs is a rust parser library for the Gedcomx date format format.
The code is available on github.
Example
use gedcomx_date::{parse, GedcomxDate};
let date = parse("+1988-03-29T03:19").unwrap();
match date {
GedcomxDate::Simple(simple_date) => {
let date = simple_date.date;
println!("{}", date.year); // 1988
println!("{}", date.month.unwrap()); // 3
println!("{}", date.day.unwrap()); // 29
let time = simple_date.time.unwrap();
println!("{}", time.hours); // 3
println!("{}", time.minutes.unwrap()); // 19
},
_ => {}
}
Structs
- A date object
- DateTime, same as simple date, but cannot be approximate. Used for ranges and approximate
- Duration
- Range
- Recurring
- Simple date
- A time object
Enums
- Gedcomx date
- Gedcomx date Enum that holds the three types of gedcomx dates
Functions
- Parses a string and extracts a Gedcomx date.