From d3083ef316e4183e7eeba7df9a1d40ed3ed2daba Mon Sep 17 00:00:00 2001 From: Simon Michael Date: Sat, 12 Dec 2009 22:19:57 +0000 Subject: [PATCH] docs: Date haddock --- Ledger/Dates.hs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Ledger/Dates.hs b/Ledger/Dates.hs index 33de7d1b8..152f448ce 100644 --- a/Ledger/Dates.hs +++ b/Ledger/Dates.hs @@ -1,9 +1,11 @@ {-| +Date parsing and utilities for hledger. + For date and time values, we use the standard Day and UTCTime types. A 'SmartDate' is a date which may be partially-specified or relative. -Eg 2008/12/31, but also 2008/12, 12/31, tomorrow, last week, next year. +Eg 2008\/12\/31, but also 2008\/12, 12\/31, tomorrow, last week, next year. We represent these as a triple of strings like (\"2008\",\"12\",\"\"), (\"\",\"\",\"tomorrow\"), (\"\",\"last\",\"week\"). @@ -115,7 +117,7 @@ spanFromSmartDate refdate sdate = DateSpan (Just b) (Just e) span (y,m,"") = (startofmonth day, nextmonth day) where day = fromGregorian (read y) (read m) 1 span (y,m,d) = (day, nextday day) where day = fromGregorian (read y) (read m) (read d) --- | Convert a smart date string to an explicit yyyy/mm/dd string using +-- | Convert a smart date string to an explicit yyyy\/mm\/dd string using -- the provided reference date. fixSmartDateStr :: Day -> String -> String fixSmartDateStr t s = printf "%04d/%02d/%02d" y m d