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

Enums

Functions

  • Parses a string and extracts a Gedcomx date.