From 5a01792fd1c35409dd28b188d05b4eb5b9ee78dc Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Mon, 26 Aug 2024 20:43:27 -0500 Subject: [PATCH] clock: simplify zeit usage Pass the timezone as part of the `instant` call. --- src/tui/status/clock.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tui/status/clock.zig b/src/tui/status/clock.zig index 6e88d02..193950e 100644 --- a/src/tui/status/clock.zig +++ b/src/tui/status/clock.zig @@ -71,9 +71,8 @@ pub fn render(self: *Self, theme: *const Widget.Theme) bool { self.plane.erase(); self.plane.home(); - const now = zeit.instant(.{}) catch return false; - const now_local = now.in(&self.tz); - const dt = now_local.time(); + const now = zeit.instant(.{ .timezone = &self.tz }) catch return false; + const dt = now.time(); _ = self.plane.print("{d:0>2}:{d:0>2}", .{ dt.hour, dt.minute }) catch {}; return false; }