authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-03-11 01:40:36 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-03-11 01:40:36 -08:00
logbfb7da7b8ee92b6c07f90a14b044a9b8f4df182c
tree93e407168f89bf37d570e5b5f49e9a40d6eafa6c
parentaff2df866eb16ad781e26a25f8b664d498e2211a

update to zig 0.11.0-dev.1681+0bb178bbb


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

time.zig+4-4
......@@ -187,7 +187,7 @@ pub const DateTime = struct {
187187
188188 pub fn dayOfThisYear(self: Self) u16 {
189189 var ret: u16 = 0;
190 for (range(self.months)) |_, item| {
190 for (range(self.months), 0..) |_, item| {
191191 ret += self.daysInMonth(@intCast(u16, item));
192192 }
193193 ret += self.days;
......@@ -212,8 +212,8 @@ pub const DateTime = struct {
212212 fn daysSinceEpoch(self: Self) u64 {
213213 var res: u64 = 0;
214214 res += self.days;
215 for (range(self.years - epoch_unix.years)) |_, i| res += time.daysInYear(@intCast(u16, i));
216 for (range(self.months)) |_, i| res += self.daysInMonth(@intCast(u16, i));
215 for (0..self.years - epoch_unix.years) |i| res += time.daysInYear(@intCast(u16, i));
216 for (0..self.months) |i| res += self.daysInMonth(@intCast(u16, i));
217217 return res;
218218 }
219219
......@@ -228,7 +228,7 @@ pub const DateTime = struct {
228228 comptime var s = 0;
229229 comptime var e = 0;
230230 comptime var next: ?FormatSeq = null;
231 inline for (fmt) |c, i| {
231 inline for (fmt, 0..) |c, i| {
232232 e = i + 1;
233233
234234 if (comptime std.meta.stringToEnum(FormatSeq, fmt[s..e])) |tag| {