showDate: use '%0C' to get a two-digit century with time-1.4.0.1 or later
This commit is contained in:
parent
25a8aa2970
commit
a56231751f
@ -77,9 +77,8 @@ import Text.Printf
|
|||||||
import Hledger.Data.Types
|
import Hledger.Data.Types
|
||||||
import Hledger.Utils
|
import Hledger.Utils
|
||||||
|
|
||||||
|
|
||||||
showDate :: Day -> String
|
showDate :: Day -> String
|
||||||
showDate = formatTime defaultTimeLocale "%C%y/%m/%d"
|
showDate = formatTime defaultTimeLocale "%0C%y/%m/%d"
|
||||||
|
|
||||||
showDateSpan (DateSpan from to) =
|
showDateSpan (DateSpan from to) =
|
||||||
concat
|
concat
|
||||||
@ -727,6 +726,7 @@ tests_Hledger_Data_Dates = TestList
|
|||||||
|
|
||||||
,"fixSmartDateStr" ~: do
|
,"fixSmartDateStr" ~: do
|
||||||
let gives = is . fixSmartDateStr (parsedate "2008/11/26")
|
let gives = is . fixSmartDateStr (parsedate "2008/11/26")
|
||||||
|
"0000-01-01" `gives` "0000/01/01"
|
||||||
"1999-12-02" `gives` "1999/12/02"
|
"1999-12-02" `gives` "1999/12/02"
|
||||||
"1999.12.02" `gives` "1999/12/02"
|
"1999.12.02" `gives` "1999/12/02"
|
||||||
"1999/3/2" `gives` "1999/03/02"
|
"1999/3/2" `gives` "1999/03/02"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user