clock: simplify zeit usage

Pass the timezone as part of the `instant` call.
This commit is contained in:
Tim Culverhouse 2024-08-26 20:43:27 -05:00 committed by CJ van den Berg
parent 4700505362
commit 5a01792fd1

View file

@ -71,9 +71,8 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool {
self.plane.erase(); self.plane.erase();
self.plane.home(); self.plane.home();
const now = zeit.instant(.{}) catch return false; const now = zeit.instant(.{ .timezone = &self.tz }) catch return false;
const now_local = now.in(&self.tz); const dt = now.time();
const dt = now_local.time();
_ = self.plane.print("{d:0>2}:{d:0>2}", .{ dt.hour, dt.minute }) catch {}; _ = self.plane.print("{d:0>2}:{d:0>2}", .{ dt.hour, dt.minute }) catch {};
return false; return false;
} }