summaryrefslogtreecommitdiff
path: root/src/times.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2010-06-20 18:37:14 -0400
committerJohn Wiegley <johnw@newartisans.com>2010-06-20 18:37:14 -0400
commit470730c92dc62377bcf455c08a818888e84ece67 (patch)
tree9389da30c0bcda3eb33c120b9dc1877eae79f75c /src/times.cc
parentfc7e67f40368914d74f6cd3521ac2b7faea01280 (diff)
downloadfork-ledger-470730c92dc62377bcf455c08a818888e84ece67.tar.gz
fork-ledger-470730c92dc62377bcf455c08a818888e84ece67.tar.bz2
fork-ledger-470730c92dc62377bcf455c08a818888e84ece67.zip
--input-date-format now affects dates with times
Diffstat (limited to 'src/times.cc')
-rw-r--r--src/times.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/times.cc b/src/times.cc
index 31367e34..72e26b91 100644
--- a/src/times.cc
+++ b/src/times.cc
@@ -310,7 +310,14 @@ string_to_month_of_year(const std::string& str)
datetime_t parse_datetime(const char * str)
{
- datetime_t when = input_datetime_io->parse(str);
+ char buf[128];
+ std::strcpy(buf, str);
+
+ for (char * p = buf; *p; p++)
+ if (*p == '.' || *p == '-')
+ *p = '/';
+
+ datetime_t when = input_datetime_io->parse(buf);
if (when.is_not_a_date_time())
throw_(date_error, _("Invalid date/time: %1") << str);
return when;