old-locale 1.0.0.5 → 1.0.0.6
raw patch · 3 files changed
+74/−29 lines, 3 filesdep ~basenew-uploader
Dependency ranges changed: base
Files
- System/Locale.hs +28/−20
- changelog.md +21/−0
- old-locale.cabal +25/−9
System/Locale.hs view
@@ -1,21 +1,22 @@ {-# LANGUAGE CPP #-}-#if __GLASGOW_HASKELL__ >= 701+#if __GLASGOW_HASKELL__ >= 701 && MIN_VERSION_base(4,4,1) {-# LANGUAGE Safe #-} #endif ----------------------------------------------------------------------------- -- | -- Module : System.Locale -- Copyright : (c) The University of Glasgow 2001--- License : BSD-style (see the file libraries/base/LICENSE)--- +-- License : BSD3 (see LICENSE file)+-- -- Maintainer : libraries@haskell.org -- Stability : stable -- Portability : portable -- -- This module provides the ability to adapt to local conventions.+-- -- At present, it supports only time and date information as used by--- System.Time.calendarTimeToString from the System.Time module in the--- old-time package.+-- @calendarTimeToString@ from the @System.Time@ module in the+-- @old-time@ package. -- ----------------------------------------------------------------------------- @@ -24,7 +25,7 @@ TimeLocale(..) , defaultTimeLocale- + , iso8601DateFormat , rfc822DateFormat )@@ -33,23 +34,23 @@ import Prelude data TimeLocale = TimeLocale {- -- |full and abbreviated week days+ -- |full and abbreviated week days wDays :: [(String, String)],- -- |full and abbreviated months+ -- |full and abbreviated months months :: [(String, String)], intervals :: [(String, String)],- -- |AM\/PM symbols+ -- |AM\/PM symbols amPm :: (String, String),- -- |formatting strings+ -- |formatting strings dateTimeFmt, dateFmt,- timeFmt, time12Fmt :: String + timeFmt, time12Fmt :: String } deriving (Eq, Ord, Show) -defaultTimeLocale :: TimeLocale -defaultTimeLocale = TimeLocale { - wDays = [("Sunday", "Sun"), ("Monday", "Mon"), - ("Tuesday", "Tue"), ("Wednesday", "Wed"), - ("Thursday", "Thu"), ("Friday", "Fri"), +defaultTimeLocale :: TimeLocale+defaultTimeLocale = TimeLocale {+ wDays = [("Sunday", "Sun"), ("Monday", "Mon"),+ ("Tuesday", "Tue"), ("Wednesday", "Wed"),+ ("Thursday", "Thu"), ("Friday", "Fri"), ("Saturday", "Sat")], months = [("January", "Jan"), ("February", "Feb"),@@ -76,15 +77,22 @@ } --- |Normally, ISO-8601 just defines YYYY-MM-DD--- but we can add a time spec.+{- | Construct format string according to <http://en.wikipedia.org/wiki/ISO_8601 ISO-8601>. +The @Maybe String@ argument allows to supply an optional time specification. E.g.:++@+'iso8601DateFormat' Nothing == "%Y-%m-%d" -- i.e. @/YYYY-MM-DD/@+'iso8601DateFormat' (Just "%H:%M:%S") == "%Y-%m-%dT%H:%M:%S" -- i.e. @/YYYY-MM-DD/T/HH:MM:SS/@+@+-}+ iso8601DateFormat :: Maybe String -> String iso8601DateFormat mTimeFmt = "%Y-%m-%d" ++ case mTimeFmt of- Nothing -> "" + Nothing -> "" Just fmt -> 'T' : fmt -+-- | Format string according to <http://tools.ietf.org/html/rfc822#section-5 RFC822>. rfc822DateFormat :: String rfc822DateFormat = "%a, %_d %b %Y %H:%M:%S %Z"
+ changelog.md view
@@ -0,0 +1,21 @@+# Changelog for [`old-locale` package](http://hackage.haskell.org/package/old-locale)++## 1.0.0.6 *Mar 2014*++ * Bundled with GHC 7.8.1++ * Update Haddock comments++ * Update to Cabal 1.10 format++## 1.0.0.5 *Sep 2012*++ * Bundled with GHC 7.6.1++ * Un-deprecate `old-locale` package++## 1.0.0.4 *Feb 2012*++ * Bundled with GHC 7.4.1++ * Add support for SafeHaskell
old-locale.cabal view
@@ -1,23 +1,39 @@ name: old-locale-version: 1.0.0.5+version: 1.0.0.6+-- GHC 7.6.1 released with 1.0.0.5 license: BSD3 license-file: LICENSE maintainer: libraries@haskell.org-bug-reports: http://hackage.haskell.org/trac/ghc/newticket?component=libraries%20%28other%29+bug-reports: http://ghc.haskell.org/trac/ghc/newticket?component=libraries%20%28other%29&keywords=old-locale synopsis: locale library category: System+build-type: Simple+Cabal-Version:>=1.10+tested-with: GHC==7.6.3, GHC==7.6.2, GHC==7.6.1, GHC==7.4.2, GHC==7.4.1, GHC==7.2.2, GHC==7.2.1, GHC==7.0.4, GHC==7.0.3, GHC==7.0.2, GHC==7.0.1, GHC==6.12.3 description: This package provides the ability to adapt to locale conventions such as date and time formats.-build-type: Simple-Cabal-Version: >= 1.6 -Library- exposed-modules:- System.Locale- build-depends: base >= 3 && < 5+extra-source-files:+ changelog.md source-repository head type: git- location: http://darcs.haskell.org/packages/old-locale.git/+ location: http://git.haskell.org/packages/old-locale.git +source-repository this+ type: git+ location: http://git.haskell.org/packages/old-locale.git+ tag: old-locale-1.0.0.6-release++Library+ default-language: Haskell98+ if impl(ghc>=7.2)+ -- && base>=4.4.1+ other-extensions: Safe++ exposed-modules:+ System.Locale++ build-depends: base >= 4.2 && < 4.8+ ghc-options: -Wall