authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-21 20:34:47 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-21 20:34:47 -07:00
logf3f901b66d670958d4fe929738160f286f923027
treec56e28d66cc4784b58564581ad0735320fafaafc
parent3a2e4b7966ae81c8ef6ddc12a2ff9769be8f2357

cleanup formatting codes


1 files changed, 4 insertions(+), 7 deletions(-)

time.zig+4-7
......@@ -192,7 +192,7 @@ pub const DateTime = struct {
192192 switch (tag) {
193193 .ddd => try writer.writeAll(@tagName(self.weekday)),
194194 .DD => try writer.print("{:0>2}", .{self.days + 1}),
195 .YYYY => try writer.print("{:0>4}", .{self.years}),
195 .YYY => try writer.print("{:0>4}", .{self.years}),
196196 .HH => try writer.print("{:0>2}", .{self.hours}),
197197 .mm => try writer.print("{:0>2}", .{self.minutes}),
198198 .ss => try writer.print("{:0>2}", .{self.seconds}),
......@@ -206,8 +206,6 @@ pub const DateTime = struct {
206206
207207 else => @compileError("'" ++ @tagName(tag) ++ "' not currently supported"),
208208
209 // stubs to make the parser work
210 .YYY => @compileError(comptime std.fmt.comptimePrint("'{s}' is not a valid format sequence", .{@tagName(tag)})),
211209 }
212210 next = null;
213211 s = i;
......@@ -264,11 +262,10 @@ pub const DateTime = struct {
264262 W, // 1 2 ... 52 53 (ISO)
265263 Wo, // 1st 2nd ... 52nd 53rd
266264 WW, // 01 02 ... 52 53
267 YY, // 70 71 ... 29 30
268 YYY, // stub
269 YYYY, // 1970 1971 ... 2029 2030
270 YYYYYY, // -001970 -001971 ... +001907 +001971
271265 Y, // 1970 1971 ... 9999 +10000 +10001
266 YY, // 70 71 ... 29 30
267 YYY, // 1970 1971 ... 2029 2030
268 YYYY, // -001970 -001971 ... +001907 +001971
272269 y, // 1 2 ... 2020 ... (era)
273270 N, // BC AD
274271 NN, // Before Christ ... Anno Domini