Skip to content

Commit e1c53b9

Browse files
committed
wait we don't even need that cpp
1 parent 05a1a73 commit e1c53b9

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

persistent/Database/Persist/Class/PersistField.hs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -324,20 +324,14 @@ instance PersistField UTCTime where
324324
where
325325
parse8601 = parseTime' "%FT%T%Q"
326326
parsePretty = parseTime' "%F %T%Q"
327+
parseTime' = parseTimeM True defaultTimeLocale
327328
fromPersistValue x@(PersistByteString s) =
328329
case reads $ unpack s of
329330
(d, _):_ -> Right d
330331
_ -> Left $ fromPersistValueParseError "UTCTime" x
331332

332333
fromPersistValue x = Left $ fromPersistValueError "UTCTime" "time, integer, string, or bytestring" x
333334

334-
#if MIN_VERSION_time(1,5,0)
335-
parseTime' :: String -> Maybe UTCTime
336-
parseTime' = parseTimeM True defaultTimeLocale
337-
#else
338-
parseTime' :: String -> Maybe UTCTime
339-
parseTime' = parseTime defaultTimeLocale
340-
#endif
341335

342336
-- | Prior to @persistent-2.11.0@, we provided an instance of
343337
-- 'PersistField' for the 'Natural' type. This was in error, because

0 commit comments

Comments
 (0)