#![allow(dead_code)]
use flexibility::jiff::Timestamp;
use flexibility::jiff::civil::{Date, date};
use flexibility::jiff::tz::TimeZone;
use flexibility::{Grid, IspDuration, Provenance, Window};
pub fn berlin() -> TimeZone {
TimeZone::get("Europe/Berlin").expect("bundled zone")
}
pub fn day() -> Grid {
day_of(date(2026, 12, 1))
}
pub fn day_of(d: Date) -> Grid {
Grid::day(d, &berlin(), IspDuration::FIFTEEN_MINUTES).expect("day grid")
}
pub fn at(hour: i8, minute: i8) -> Timestamp {
date(2026, 12, 1)
.at(hour, minute, 0, 0)
.to_zoned_datetime(berlin())
.expect("local time")
.timestamp()
}
pub fn dso() -> Provenance {
Provenance::new("dso.example", "order-42", at(12, 0))
}
pub fn fuse() -> Provenance {
Provenance::new("site.example", "main-fuse", at(0, 0))
}
pub fn agr() -> Provenance {
Provenance::new("agr.example", "plan-7", at(12, 0))
}
pub fn win(h1: i8, m1: i8, h2: i8, m2: i8) -> Window {
Window::new(at(h1, m1), at(h2, m2)).expect("non-empty window")
}