summaryrefslogtreecommitdiff
path: root/src/times.h
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/times.h
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/times.h')
-rw-r--r--src/times.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/times.h b/src/times.h
index 9750bbfb..141066a5 100644
--- a/src/times.h
+++ b/src/times.h
@@ -73,14 +73,18 @@ inline bool is_valid(const date_t& moment) {
#endif
#define CURRENT_DATE() boost::gregorian::day_clock::universal_day()
-extern int start_of_week;
+extern date_time::weekdays start_of_week;
extern optional<std::string> input_date_format;
-date_time::weekdays string_to_day_of_week(const std::string& str);
+optional<date_time::weekdays>
+string_to_day_of_week(const std::string& str);
+optional<date_time::months_of_year>
+string_to_month_of_year(const std::string& str);
datetime_t parse_datetime(const char * str, int current_year = -1);
-inline datetime_t parse_datetime(const std::string& str, int current_year = -1) {
+inline datetime_t parse_datetime(const std::string& str,
+ int current_year = -1) {
return parse_datetime(str.c_str(), current_year);
}