diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2017-09-27 21:02:09 +0200 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2017-09-27 21:02:09 +0200 |
commit | 62cab4b862f21cf6fe45e6d2e2209d3c7930bc22 (patch) | |
tree | a17a4b5aecf923802e845754c10f1b54c884494e /src | |
parent | 5fd920b4d6a7bf089dd1a2030963c68838b69307 (diff) |
Hand-write month-adjusting in add adjusting algorithm
Because we do not have a `>=` comparison operator here, but a `>`.
Diffstat (limited to 'src')
-rw-r--r-- | src/util.rs | 5 |
1 files changed, 4 insertions, 1 deletions
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) } |