summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-06-18 00:50:27 +0100
committerJohn Wiegley <johnw@newartisans.com>2009-06-18 00:50:27 +0100
commited9735f66d7a034972236b51527a5aad6301c221 (patch)
tree2739451a0930bb60e9e4c4adb6991a9928fb9277 /src
parenta64c249efbf9447d1dca72668927dc017946ad5a (diff)
downloadfork-ledger-ed9735f66d7a034972236b51527a5aad6301c221.tar.gz
fork-ledger-ed9735f66d7a034972236b51527a5aad6301c221.tar.bz2
fork-ledger-ed9735f66d7a034972236b51527a5aad6301c221.zip
Correctly parse the range of period "june 2008"
Diffstat (limited to 'src')
-rw-r--r--src/times.cc8
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);
}
}