summaryrefslogtreecommitdiff
path: root/src/global.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-03-23 01:22:26 -0400
committerJohn Wiegley <johnw@newartisans.com>2009-03-23 01:22:26 -0400
commitdda7c3a58ab73a567e26f160ffa0b87bacb7db50 (patch)
tree493bce3bdec577fd1f3dc116a0de5c4daf2671de /src/global.cc
parentaba7a39e87ef0a2443273481865ef4c6370a32cd (diff)
downloadfork-ledger-dda7c3a58ab73a567e26f160ffa0b87bacb7db50.tar.gz
fork-ledger-dda7c3a58ab73a567e26f160ffa0b87bacb7db50.tar.bz2
fork-ledger-dda7c3a58ab73a567e26f160ffa0b87bacb7db50.zip
Rewrote the date interval parser/stepper
The new implementation uses boost::gregorian::date_duration objects, rather than manually stepping.
Diffstat (limited to 'src/global.cc')
-rw-r--r--src/global.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/global.cc b/src/global.cc
index 3b491c0e..a258d0bb 100644
--- a/src/global.cc
+++ b/src/global.cc
@@ -387,8 +387,11 @@ void global_scope_t::normalize_report_options(const string& verb)
output_datetime_format = rep.HANDLER(date_format_).str() + " %H:%M:%S";
output_date_format = rep.HANDLER(date_format_).str();
}
- if (rep.HANDLED(start_of_week_))
- start_of_week = string_to_day_of_week(rep.HANDLER(start_of_week_).str());
+ if (rep.HANDLED(start_of_week_)) {
+ if (optional<date_time::weekdays> weekday =
+ string_to_day_of_week(rep.HANDLER(start_of_week_).str()))
+ start_of_week = *weekday;
+ }
// jww (2008-08-14): This code really needs to be rationalized away for 3.0.
// I might be able to do it with command objects, like register_t, which