From 69e0b590ee4ff73b611fb18a49f0abbb904de6cc Mon Sep 17 00:00:00 2001 From: stolz Date: Fri, 30 Aug 2002 13:43:57 +0000 Subject: [PATCH] [project @ 2002-08-30 13:43:57 by stolz] Haddock-ise with comments from library report --- System/Locale.hs | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/System/Locale.hs b/System/Locale.hs index 556e174..582d288 100644 --- a/System/Locale.hs +++ b/System/Locale.hs @@ -12,8 +12,14 @@ -- ----------------------------------------------------------------------------- -module System.Locale - ( TimeLocale(..) +module System.Locale ( + + -- |The 'Locale' library provides the ability to adapt to local conventions. + -- At present, it supports only time and date information as used by + -- 'calendarTimeToString' from the "System.Time" library. + + TimeLocale(..) + , defaultTimeLocale , iso8601DateFormat @@ -24,11 +30,15 @@ where import Prelude data TimeLocale = TimeLocale { - wDays :: [(String, String)], -- full and abbreviated week days - months :: [(String, String)], -- full and abbreviated months + -- |full and abbreviated week days + wDays :: [(String, String)], + -- |full and abbreviated months + months :: [(String, String)], intervals :: [(String, String)], - amPm :: (String, String), -- AM/PM symbols - dateTimeFmt, dateFmt, -- formatting strings + -- |AM\/PM symbols + amPm :: (String, String), + -- |formatting strings + dateTimeFmt, dateFmt, timeFmt, time12Fmt :: String } deriving (Eq, Ord, Show) @@ -63,11 +73,14 @@ defaultTimeLocale = TimeLocale { } +-- |Normally, ISO-8601 just defines YYYY-MM-DD +-- but we can add a time spec. + iso8601DateFormat :: Maybe String -> String iso8601DateFormat timeFmt = "%Y-%m-%d" ++ case timeFmt of - Nothing -> "" -- normally, ISO-8601 just defines YYYY-MM-DD - Just fmt -> ' ' : fmt -- but we can add a time spec + Nothing -> "" + Just fmt -> ' ' : fmt rfc822DateFormat :: String -- 1.7.10.4