authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-24 04:27:17 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-24 04:27:17 -07:00
log4048e8b17ade544b6afc4c85a0503ab7e2e068f4
treed142e5b3a0a0887384997e1e70c93c99c51721d4
parentb62a4341424d566e5c025ed41e796418dee53a89

add the era property


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

time.zig+7
......@@ -12,6 +12,7 @@ pub const DateTime = struct {
1212 years: u16,
1313 timezone: TimeZone,
1414 weekday: WeekDay,
15 era: Era,
1516
1617 const Self = @This();
1718
......@@ -48,6 +49,7 @@ pub const DateTime = struct {
4849 .years = 1970,
4950 .timezone = .UTC,
5051 .weekday = .Thu,
52 .era = .AD,
5153 };
5254
5355 pub fn eql(self: Self, other: Self) bool {
......@@ -378,6 +380,11 @@ pub const WeekDay = enum {
378380 }
379381};
380382
383pub const Era = enum {
384 // BC,
385 AD,
386};
387
381388fn printOrdinal(writer: anytype, num: u16) !void {
382389 try writer.print("{}", .{num});
383390 try writer.writeAll(switch (num) {