timeglyph 0.9.7

Forensic timestamp decipherment — decode, encode, and identify the many ways systems inscribe time, with scored, cited, ambiguity-first interpretation.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! The weekday shown after each reading is derived from the *displayed* ISO date
//! (so it always matches what the row shows, regardless of zone/format).
#![allow(clippy::unwrap_used)]

use timeglyph::scan;

#[test]
fn weekday_from_the_displayed_iso_date() {
    // 2020-01-01 is a Wednesday; 2021-07-01 is a Thursday.
    assert_eq!(scan::weekday("2020-01-01T00:00:00Z"), Some("Wednesday"));
    assert_eq!(scan::weekday("2021-07-01T12:00:00+08:00"), Some("Thursday"));
}

#[test]
fn weekday_is_none_for_a_non_date() {
    assert_eq!(scan::weekday("local text"), None);
    assert_eq!(scan::weekday("short"), None);
}