| ... | @@ -1,6 +1,7 @@ | ... | @@ -1,6 +1,7 @@ |
| 1 | const std = @import("std"); | 1 | const std = @import("std"); |
| 2 | const string = []const u8; | 2 | const string = []const u8; |
| 3 | const range = @import("range").range; | 3 | const range = @import("range").range; |
| | 4 | const extras = @import("extras"); |
| 4 | const time = @This(); | 5 | const time = @This(); |
| 5 | | 6 | |
| 6 | pub const DateTime = struct { | 7 | pub const DateTime = struct { |
| ... | @@ -405,10 +406,7 @@ pub const format = struct { | ... | @@ -405,10 +406,7 @@ pub const format = struct { |
| 405 | pub const TimeZone = enum { | 406 | pub const TimeZone = enum { |
| 406 | UTC, | 407 | UTC, |
| 407 | | 408 | |
| 408 | pub fn jsonStringify(self: @This(), options: std.json.StringifyOptions, out_stream: anytype) !void { | 409 | usingnamespace extras.TagNameJsonStringifyMixin(@This()); |
| 409 | _ = options; | | |
| 410 | try out_stream.writeAll(@tagName(self)); | | |
| 411 | } | | |
| 412 | }; | 410 | }; |
| 413 | | 411 | |
| 414 | pub const WeekDay = enum { | 412 | pub const WeekDay = enum { |
| ... | @@ -432,20 +430,14 @@ pub const WeekDay = enum { | ... | @@ -432,20 +430,14 @@ pub const WeekDay = enum { |
| 432 | }; | 430 | }; |
| 433 | } | 431 | } |
| 434 | | 432 | |
| 435 | pub fn jsonStringify(self: @This(), options: std.json.StringifyOptions, out_stream: anytype) !void { | 433 | usingnamespace extras.TagNameJsonStringifyMixin(@This()); |
| 436 | _ = options; | | |
| 437 | try out_stream.writeAll(@tagName(self)); | | |
| 438 | } | | |
| 439 | }; | 434 | }; |
| 440 | | 435 | |
| 441 | pub const Era = enum { | 436 | pub const Era = enum { |
| 442 | // BC, | 437 | // BC, |
| 443 | AD, | 438 | AD, |
| 444 | | 439 | |
| 445 | pub fn jsonStringify(self: @This(), options: std.json.StringifyOptions, out_stream: anytype) !void { | 440 | usingnamespace extras.TagNameJsonStringifyMixin(@This()); |
| 446 | _ = options; | | |
| 447 | try out_stream.writeAll(@tagName(self)); | | |
| 448 | } | | |
| 449 | }; | 441 | }; |
| 450 | | 442 | |
| 451 | pub fn isLeapYear(year: u16) bool { | 443 | pub fn isLeapYear(year: u16) bool { |