From 250c92f64623eada3cfc3f55d400b8ec2c30127e Mon Sep 17 00:00:00 2001 From: tim Date: Tue, 9 Dec 2008 07:15:18 +0000 Subject: [PATCH] Support parsing of dates in yyyy-dd-mm format --- Ledger/Dates.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Ledger/Dates.hs b/Ledger/Dates.hs index 5565b693f..ad800bd1f 100644 --- a/Ledger/Dates.hs +++ b/Ledger/Dates.hs @@ -198,12 +198,14 @@ startofyear day = fromGregorian y 1 1 where (y,_,_) = toGregorian day parsedatetime :: String -> UTCTime parsedatetime s = parsetimewith "%Y/%m/%d %H:%M:%S" s $ + parsetimewith "%Y-%m-%d %H:%M:%S" s $ error $ printf "could not parse timestamp \"%s\"" s -- | Parse a date string to a time type, or raise an error. parsedate :: String -> Day parsedate s = parsetimewith "%Y/%m/%d" s $ + parsetimewith "%Y-%m-%d" s $ error $ printf "could not parse date \"%s\"" s -- | Parse a time string to a time type using the provided pattern, or