b56a648cd26bed2317592bd8371e061229126770
[haskell-report.git] / report / lib-code / Locale.hs
1 module Locale(TimeLocale(..), defaultTimeLocale) where
2
3 data TimeLocale = TimeLocale {
4 wDays :: [(String, String)], -- full and abbreviated week days
5 months :: [(String, String)], -- full and abbreviated months
6 amPm :: (String, String), -- AM/PM symbols
7 dateTimeFmt, dateFmt, -- formatting strings
8 timeFmt, time12Fmt :: String
9 } deriving (Eq, Ord, Show)
10
11 defaultTimeLocale :: TimeLocale
12 defaultTimeLocale = TimeLocale {
13 wDays = [("Sunday", "Sun"), ("Monday", "Mon"),
14 ("Tuesday", "Tue"), ("Wednesday", "Wed"),
15 ("Thursday", "Thu"), ("Friday", "Fri"),
16 ("Saturday", "Sat")],
17
18 months = [("January", "Jan"), ("February", "Feb"),
19 ("March", "Mar"), ("April", "Apr"),
20 ("May", "May"), ("June", "Jun"),
21 ("July", "Jul"), ("August", "Aug"),
22 ("September", "Sep"), ("October", "Oct"),
23 ("November", "Nov"), ("December", "Dec")],
24
25 amPm = ("AM", "PM"),
26 dateTimeFmt = "%a %b %e %H:%M:%S %Z %Y",
27 dateFmt = "%m/%d/%y",
28 timeFmt = "%H:%M:%S",
29 time12Fmt = "%I:%M:%S %p"
30 }