From dda7c3a58ab73a567e26f160ffa0b87bacb7db50 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Mon, 23 Mar 2009 01:22:26 -0400 Subject: Rewrote the date interval parser/stepper The new implementation uses boost::gregorian::date_duration objects, rather than manually stepping. --- src/times.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/times.h') 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 input_date_format; -date_time::weekdays string_to_day_of_week(const std::string& str); +optional +string_to_day_of_week(const std::string& str); +optional +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); } -- cgit v1.2.3