AJChapman / formatting

Format strings type-safely with combinators
BSD 3-Clause "New" or "Revised" License
164 stars 39 forks source link

Add helper for creating custom time formatters #21

Closed jhickner closed 8 years ago

jhickner commented 8 years ago

Currently there isn't a way to e.g. remove the padding from dateSlash or dayOfMonth. This PR adds a helper that lets you define custom date formats, for instance:

-- 5/4/2016 vs 05/04/2016 from `dateSlash`
dateSlashNoPadding = customTimeFmt "%-m/%-d/%Y"

-- 4 vs 04 from `dayOfMonth`
dayOfMonthNoPadding = customTimeFmt "%-d"
chrisdone commented 8 years ago

👍