authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-21 20:35:44 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-21 20:35:44 -07:00
logf9a433b782d15b6526af2faf3e222eb4efe7f6cd
tree487c007438febbcffc6bbe05b301d0438805c857
parent5c935d4328e0484cd24f8b3f7c77ce9ffa8a90c7

add eql(DateTime, DateTime) bool


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

time.zig+12
......@@ -46,6 +46,18 @@ pub const DateTime = struct {
4646 .weekday = .Thu,
4747 };
4848
49 pub fn eql(self: Self, other: Self) bool {
50 return self.ms == other.ms and
51 self.seconds == other.seconds and
52 self.minutes == other.minutes and
53 self.hours == other.hours and
54 self.days == other.days and
55 self.months == other.months and
56 self.years == other.years and
57 self.timezone == other.timezone and
58 self.weekday == other.weekday;
59 }
60
4961 pub fn addMs(self: Self, count: u64) Self {
5062 if (count == 0) return self;
5163 var result = self;