| ... | @@ -12,6 +12,7 @@ pub const DateTime = struct { | ... | @@ -12,6 +12,7 @@ pub const DateTime = struct { |
| 12 | years: u16, | 12 | years: u16, |
| 13 | timezone: TimeZone, | 13 | timezone: TimeZone, |
| 14 | weekday: WeekDay, | 14 | weekday: WeekDay, |
| | 15 | era: Era, |
| 15 | | 16 | |
| 16 | const Self = @This(); | 17 | const Self = @This(); |
| 17 | | 18 | |
| ... | @@ -48,6 +49,7 @@ pub const DateTime = struct { | ... | @@ -48,6 +49,7 @@ pub const DateTime = struct { |
| 48 | .years = 1970, | 49 | .years = 1970, |
| 49 | .timezone = .UTC, | 50 | .timezone = .UTC, |
| 50 | .weekday = .Thu, | 51 | .weekday = .Thu, |
| | 52 | .era = .AD, |
| 51 | }; | 53 | }; |
| 52 | | 54 | |
| 53 | pub fn eql(self: Self, other: Self) bool { | 55 | pub fn eql(self: Self, other: Self) bool { |
| ... | @@ -378,6 +380,11 @@ pub const WeekDay = enum { | ... | @@ -378,6 +380,11 @@ pub const WeekDay = enum { |
| 378 | } | 380 | } |
| 379 | }; | 381 | }; |
| 380 | | 382 | |
| | 383 | pub const Era = enum { |
| | 384 | // BC, |
| | 385 | AD, |
| | 386 | }; |
| | 387 | |
| 381 | fn printOrdinal(writer: anytype, num: u16) !void { | 388 | fn printOrdinal(writer: anytype, num: u16) !void { |
| 382 | try writer.print("{}", .{num}); | 389 | try writer.print("{}", .{num}); |
| 383 | try writer.writeAll(switch (num) { | 390 | try writer.writeAll(switch (num) { |