aboutsummaryrefslogtreecommitdiff
path: root/config.ha
diff options
context:
space:
mode:
Diffstat (limited to 'config.ha')
-rw-r--r--config.ha15
1 files changed, 8 insertions, 7 deletions
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);
};
};