time-compat 1.9.2.2 → 1.9.3
raw patch · 4 files changed
+68/−16 lines, 4 filesdep ~base-compatdep ~time
Dependency ranges changed: base-compat, time
Files
- CHANGELOG.md +4/−0
- src/Data/Time/Format/Compat.hs +25/−0
- src/Data/Time/LocalTime/Compat.hs +11/−0
- time-compat.cabal +28/−16
+ CHANGELOG.md view
@@ -0,0 +1,4 @@+# 1.9.3++- Include `pastMidnight` and `sinceMidnight` aliases (backported from `time-1.10`)+- Support `time-1.10`
src/Data/Time/Format/Compat.hs view
@@ -93,5 +93,30 @@ -> m t -- ^ Return the time value, or fail if the in parseTimeM = Data.Time.Format.parseTimeM #endif+#endif +#if MIN_VERSION_time(1,10,0)+{-# DEPRECATED parseTime "use \"parseTimeM True\" instead" #-}+parseTime :: ParseTime t =>+ TimeLocale -- ^ Time locale.+ -> String -- ^ Format string.+ -> String -- ^ Input string.+ -> Maybe t -- ^ The time value, or 'Nothing' if the input could+ -- not be parsed using the given format.+parseTime = parseTimeM True++{-# DEPRECATED readTime "use \"parseTimeOrError True\" instead" #-}+readTime :: ParseTime t =>+ TimeLocale -- ^ Time locale.+ -> String -- ^ Format string.+ -> String -- ^ Input string.+ -> t -- ^ The time value.+readTime = parseTimeOrError True++{-# DEPRECATED readsTime "use \"readSTime True\" instead" #-}+readsTime :: ParseTime t =>+ TimeLocale -- ^ Time locale.+ -> String -- ^ Format string+ -> ReadS t+readsTime = readSTime True #endif
src/Data/Time/LocalTime/Compat.hs view
@@ -12,6 +12,7 @@ utcToLocalTimeOfDay,localToUTCTimeOfDay, timeToTimeOfDay,timeOfDayToTime, dayFractionToTimeOfDay,timeOfDayToDayFraction,+ pastMidnight, sinceMidnight, -- * CalendarDiffTime CalendarDiffTime (..),@@ -60,6 +61,16 @@ daysAndTimeOfDayToTime :: Integer -> TimeOfDay -> NominalDiffTime daysAndTimeOfDayToTime d (TimeOfDay dh hm ms) = (+) (realToFrac ms) $ (*) 60 $ (+) (realToFrac hm) $ (*) 60 $ (+) (realToFrac dh) $ (*) 24 $ realToFrac d +#endif++#if !MIN_VERSION_time(1,10,0)+-- | Same as 'timeToTimeOfDay'.+pastMidnight :: DiffTime -> TimeOfDay+pastMidnight = timeToTimeOfDay++-- | Same as 'timeOfDayToTime'.+sinceMidnight :: TimeOfDay -> DiffTime+sinceMidnight = timeOfDayToTime #endif -------------------------------------------------------------------------------
time-compat.cabal view
@@ -1,7 +1,7 @@-cabal-version: 1.12-name: time-compat-version: 1.9.2.2-synopsis: Compatibility package for time+cabal-version: 1.12+name: time-compat+version: 1.9.3+synopsis: Compatibility package for time description: This packages tries to compat as much of @time@ features as possible. .@@ -13,16 +13,28 @@ . * @dayFractionToTimeOfDay@ on extreme values -category: Time, Compatibility-license: BSD3-license-file: LICENSE-maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>-author: Ashley Yakeley-homepage: https://github.com/phadej/time-compat-bug-reports: https://github.com/phadej/time-compat/issues-build-type: Simple+category: Time, Compatibility+license: BSD3+license-file: LICENSE+maintainer: Oleg Grenrus <oleg.grenrus@iki.fi>+author: Ashley Yakeley+homepage: https://github.com/phadej/time-compat+bug-reports: https://github.com/phadej/time-compat/issues+build-type: Simple+extra-source-files: CHANGELOG.md tested-with:- GHC ==8.8.1 || ==8.6.5 || ==8.4.4 || ==8.2.2 || ==8.0.2 || ==7.10.3 || ==7.8.4 || ==7.6.3 || ==7.4.2 || ==7.2.2 || ==7.0.4+ GHC ==7.0.4+ || ==7.2.2+ || ==7.4.2+ || ==7.6.3+ || ==7.8.4+ || ==7.10.3+ || ==8.0.2+ || ==8.2.2+ || ==8.4.4+ || ==8.6.5+ || ==8.8.3+ || ==8.10.1 source-repository head type: git@@ -42,10 +54,10 @@ default-extensions: Trustworthy build-depends:- base >=4.3 && <4.14+ base >=4.3 && <4.15 , base-orphans >=0.8.1 && <0.9 , deepseq >=1.3.0.0 && <1.4 || >=1.4.1.1 && <1.5- , time >=1.2 && <1.3 || >=1.4 && <1.7 || >=1.8 && <1.9 || >=1.9.2 && <1.9.3+ , time >=1.2 && <1.3 || >=1.4 && <1.7 || >=1.8 && <1.9 || >=1.9.2 && <1.9.4 || >=1.10 && <1.10.1 if flag(old-locale) build-depends:@@ -115,7 +127,7 @@ ghc-options: -Wall -fwarn-tabs build-depends: base- , base-compat >=0.10.5 && <0.11+ , base-compat >=0.10.5 && <0.12 , deepseq , QuickCheck >=2.13 && <2.14 , tagged >=0.8.6 && <0.9