summaryrefslogtreecommitdiff
path: root/src/pool.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-06-28 16:06:27 +0100
committerJohn Wiegley <johnw@newartisans.com>2009-06-28 16:06:27 +0100
commit0283f444c5b8d4116ac20c458ef91a29b986688e (patch)
tree86d7c24d99a691b916771ec80516b0189d539fd4 /src/pool.cc
parentbad1b1368031ce0b1de1517ca696d83351941eed (diff)
downloadfork-ledger-0283f444c5b8d4116ac20c458ef91a29b986688e.tar.gz
fork-ledger-0283f444c5b8d4116ac20c458ef91a29b986688e.tar.bz2
fork-ledger-0283f444c5b8d4116ac20c458ef91a29b986688e.zip
Date and time are optional for pricing directives
Diffstat (limited to 'src/pool.cc')
-rw-r--r--src/pool.cc10
1 files changed, 8 insertions, 2 deletions
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<price_point_t> 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;