aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanJacobs2022-04-15 17:12:20 +0200
committerSanJacobs2022-04-15 17:12:20 +0200
commitd9d505865604a4d136e143dd5186ade0baaf452e (patch)
treee3c62b00898b631f07b93d3237a01fd7af23e32d
parent16947f5750c323f8d457f8942578a544bb35118e (diff)
downloadsatscalc-d9d505865604a4d136e143dd5186ade0baaf452e.tar.gz
satscalc-d9d505865604a4d136e143dd5186ade0baaf452e.tar.bz2
satscalc-d9d505865604a4d136e143dd5186ade0baaf452e.zip
Fixed year rollover in wind()
-rwxr-xr-xsrc/time.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/time.cpp b/src/time.cpp
index d51f4ab..0d97a09 100755
--- a/src/time.cpp
+++ b/src/time.cpp
@@ -54,12 +54,12 @@ void wind(moment &input_moment, int minutes, int hours, int days) {
}
while(input_moment.day < 1) {
input_moment.month--;
- input_moment.day += days_in(input_moment.month, input_moment.year);
if(input_moment.month < 1) {
input_moment.month += 12;
input_moment.year--;
}
current_month_length = days_in(input_moment.month, input_moment.year);
+ input_moment.day += current_month_length;
}
}