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 {...@@ -80,7 +80,7 @@ pub const DateTime = struct {
80 var input = count;80 var input = count;
8181
82 while (true) {82 while (true) {
83 const year_len = self.daysThisYear();83 const year_len = result.daysThisYear();
84 if (input >= year_len) {84 if (input >= year_len) {
85 result.years += 1;85 result.years += 1;
86 input -= year_len;86 input -= year_len;
...@@ -89,7 +89,7 @@ pub const DateTime = struct {...@@ -89,7 +89,7 @@ pub const DateTime = struct {
89 break;89 break;
90 }90 }
91 while (true) {91 while (true) {
92 const month_len = self.daysThisMonth();92 const month_len = result.daysThisMonth();
93 if (input >= month_len) {93 if (input >= month_len) {
94 result.months += 1;94 result.months += 1;
95 input -= month_len;95 input -= month_len;
...@@ -103,7 +103,7 @@ pub const DateTime = struct {...@@ -103,7 +103,7 @@ pub const DateTime = struct {
103 break;103 break;
104 }104 }
105 {105 {
106 const month_len = self.daysThisMonth();106 const month_len = result.daysThisMonth();
107 if (result.days + input > month_len) {107 if (result.days + input > month_len) {
108 const left = month_len - result.days;108 const left = month_len - result.days;
109 input -= left;109 input -= left;