From 62cab4b862f21cf6fe45e6d2e2209d3c7930bc22 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Wed, 27 Sep 2017 21:02:09 +0200 Subject: Hand-write month-adjusting in add adjusting algorithm Because we do not have a `>=` comparison operator here, but a `>`. --- src/util.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/util.rs b/src/util.rs index 86437be..7730b2b 100644 --- a/src/util.rs +++ b/src/util.rs @@ -24,7 +24,10 @@ pub fn adjust_times_add(mut y: i64, mut mo: i64, mut d: i64, mut h: i64, mut mi: mo += 1; } - fix! { mo, 12, y } + while mo > 12 { + y += 1; + mo -= 12; + } (y, mo, d, h, mi, s) } -- cgit v1.2.3