diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/times.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/times.cc b/src/times.cc index 360f786a..deb51058 100644 --- a/src/times.cc +++ b/src/times.cc @@ -649,15 +649,19 @@ void date_interval_t::parse(std::istream& in) if (! end) end = *start + gregorian::days(1); } else { + bool overwrite_end = false; + if (year) { start = date_t(*year, 1, 1); - if (! end) + if (! end) { end = *start + gregorian::years(1); + overwrite_end = true; + } } if (mon) { start = date_t(start->year(), *mon, 1); - if (! end) + if (! end || overwrite_end) end = *start + gregorian::months(1); } } |