From b230946668e575f6290cf3f29afce63f8734402a Mon Sep 17 00:00:00 2001 From: Julian Hurst Date: Fri, 10 Oct 2025 19:36:27 +0200 Subject: Changes for new hare version (0.25.2) --- config.ha | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'config.ha') diff --git a/config.ha b/config.ha index d3ee234..ba454f0 100644 --- a/config.ha +++ b/config.ha @@ -1,3 +1,4 @@ +use time::date; use fmt; use dirs; use format::ini; @@ -10,12 +11,12 @@ use errors; use strings; type config = struct { - tz: chrono::locality, + tz: date::locality, }; type noexist = !str; -type conferror = !(path::error | noexist | fs::error | chrono::tzdberror); +type conferror = !(path::error | noexist | fs::error | date::tzdberror | nomem); fn loadconfig() (config | conferror) = { const confdir = dirs::config("distamp"); @@ -25,7 +26,7 @@ fn loadconfig() (config | conferror) = { case let e: errors::noentry => fmt::errorln("warn: No config file found")!; return config { - tz = chrono::LOCAL, + tz = date::LOCAL, }; case let e: fs::error => return e; @@ -35,12 +36,12 @@ fn loadconfig() (config | conferror) = { defer io::close(f)!; const sc = ini::scan(f); - let tz: chrono::locality = chrono::LOCAL; + let tz: date::locality= date::LOCAL; for (const e => ini::next(&sc)!) { const key = strings::trim(e.1); const val = strings::trim(e.2); if (key == "tz") { - tz = chrono::tz(val)?; + tz = date::tzdb(val)?; }; }; return config { @@ -54,7 +55,7 @@ fn strconferror(e: conferror) str = { return path::strerror(e); case let e: fs::error => return fs::strerror(e); - case let e: chrono::tzdberror => - return chrono::strerror(e); + case let e: date::tzdberror=> + return date::strerror(e); }; }; -- cgit v1.2.3