authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-23 23:12:51 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-23 23:12:51 -07:00
log94b512933f9e9a665ef30f466bb71a3774840239
tree920257fc223bf511216d1cb5d0525b6dae3a762a
parent437f7de0f51104f2e16e24cdb320db75bb2fbf74

fix weekday progression. was only being updated at the end


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

time.zig+2
...@@ -100,6 +100,7 @@ pub const DateTime = struct {...@@ -100,6 +100,7 @@ pub const DateTime = struct {
100 if (input >= year_len) {100 if (input >= year_len) {
101 result.years += 1;101 result.years += 1;
102 input -= year_len;102 input -= year_len;
103 result.incrementWeekday(year_len);
103 continue;104 continue;
104 }105 }
105 break;106 break;
...@@ -109,6 +110,7 @@ pub const DateTime = struct {...@@ -109,6 +110,7 @@ pub const DateTime = struct {
109 if (input >= month_len) {110 if (input >= month_len) {
110 result.months += 1;111 result.months += 1;
111 input -= month_len;112 input -= month_len;
113 result.incrementWeekday(month_len);
112114
113 if (result.months == 12) {115 if (result.months == 12) {
114 result.years += 1;116 result.years += 1;