From 0283f444c5b8d4116ac20c458ef91a29b986688e Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sun, 28 Jun 2009 16:06:27 +0100 Subject: Date and time are optional for pricing directives --- src/pool.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/pool.cc') diff --git a/src/pool.cc b/src/pool.cc index e21b900c..68ba3ed7 100644 --- a/src/pool.cc +++ b/src/pool.cc @@ -299,10 +299,16 @@ optional commodity_pool_t::parse_price_directive(char * line) if (std::isdigit(time_field_ptr[0])) { symbol_and_price = next_element(time_field_ptr); if (! symbol_and_price) return none; + datetime = parse_datetime(date_field + " " + time_field_ptr); - } else { + } + else if (std::isdigit(date_field_ptr[0])) { symbol_and_price = time_field_ptr; - datetime = parse_datetime(date_field); + datetime = datetime_t(parse_date(date_field)); + } + else { + symbol_and_price = date_field_ptr; + datetime = CURRENT_TIME(); } string symbol; -- cgit v1.2.3