c76ee9f2ae07c42c78553a22b9e42856694ad22c
[ghc-hetmet.git] / ghc / lib / std / Locale.lhs
1 %
2 % (c) The GRASP/AQUA Project, Glasgow University, 1995-97
3 %
4 \section[Time]{Haskell 1.4 Locale Library}
5
6
7 \begin{code}
8 module Locale(TimeLocale(..), defaultTimeLocale) where
9
10 import Prelude  -- so as to force recompilations when reqd.
11
12 data TimeLocale = TimeLocale {
13         wDays  :: [(String, String)],   -- full and abbreviated week days
14         months :: [(String, String)],   -- full and abbreviated months
15         amPm   :: (String, String),     -- AM/PM symbols
16         dateTimeFmt, dateFmt,           -- formatting strings
17         timeFmt, time12Fmt :: String     
18         } deriving (Eq, Ord, Show)
19
20 defaultTimeLocale :: TimeLocale 
21 defaultTimeLocale =  TimeLocale { 
22         wDays  = [("Sunday",   "Sun"),  ("Monday",    "Mon"),   
23                   ("Tuesday",  "Tue"),  ("Wednesday", "Wed"), 
24                   ("Thursday", "Thu"),  ("Friday",    "Fri"), 
25                   ("Saturday", "Sat")],
26
27         months = [("January",   "Jan"), ("February",  "Feb"),
28                   ("March",     "Mar"), ("April",     "Apr"),
29                   ("May",       "May"), ("June",      "Jun"),
30                   ("July",      "Jul"), ("August",    "Aug"),
31                   ("September", "Sep"), ("October",   "Oct"),
32                   ("November",  "Nov"), ("December",  "Dec")],
33
34         amPm = ("AM", "PM"),
35         dateTimeFmt = "%a %b %e %H:%M:%S %Z %Y",
36         dateFmt = "%m/%d/%y",
37         timeFmt = "%H:%M:%S",
38         time12Fmt = "%I:%M:%S %p"
39         }
40
41 \end{code}