From ed9735f66d7a034972236b51527a5aad6301c221 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Thu, 18 Jun 2009 00:50:27 +0100 Subject: [PATCH] Correctly parse the range of period "june 2008" --- src/times.cc | 8 ++++++-- 1 file 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); } }