authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-21 20:34:23 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2021-10-21 20:34:23 -07:00
log3a2e4b7966ae81c8ef6ddc12a2ff9769be8f2357
treeeed0642a5ff6b824f342aa21123c8a69ac81419d
parent12ee22949f562288588f8fe612c3bce3b258c036

fix typo that caused days to be slightly off


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

time.zig+3-3
......@@ -80,7 +80,7 @@ pub const DateTime = struct {
8080 var input = count;
8181
8282 while (true) {
83 const year_len = self.daysThisYear();
83 const year_len = result.daysThisYear();
8484 if (input >= year_len) {
8585 result.years += 1;
8686 input -= year_len;
......@@ -89,7 +89,7 @@ pub const DateTime = struct {
8989 break;
9090 }
9191 while (true) {
92 const month_len = self.daysThisMonth();
92 const month_len = result.daysThisMonth();
9393 if (input >= month_len) {
9494 result.months += 1;
9595 input -= month_len;
......@@ -103,7 +103,7 @@ pub const DateTime = struct {
103103 break;
104104 }
105105 {
106 const month_len = self.daysThisMonth();
106 const month_len = result.daysThisMonth();
107107 if (result.days + input > month_len) {
108108 const left = month_len - result.days;
109109 input -= left;