From d9d505865604a4d136e143dd5186ade0baaf452e Mon Sep 17 00:00:00 2001 From: SanJacobs Date: Fri, 15 Apr 2022 17:12:20 +0200 Subject: Fixed year rollover in wind() --- src/time.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } } -- cgit v1.2.1