+-- | (Un)pickle a UTCTime without the date portion, allowing for a
+-- value of \"TBA\" (which gets translated to 'Nothing').
+--
+xp_tba_time :: PU (Maybe UTCTime)
+xp_tba_time =
+ (to_time, from_time) `xpWrap` xpText
+ where
+ to_time :: String -> Maybe UTCTime
+ to_time s
+ | s == "TBA" = Nothing
+ | otherwise = parseTime defaultTimeLocale xp_time_format s
+
+ from_time :: Maybe UTCTime -> String
+ from_time Nothing = ""
+ from_time (Just t) = formatTime defaultTimeLocale xp_time_format t
+