aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/Txt2Tags.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Txt2Tags.hs b/src/Text/Pandoc/Readers/Txt2Tags.hs
index f27a3fc2c..d355a4b55 100644
--- a/src/Text/Pandoc/Readers/Txt2Tags.hs
+++ b/src/Text/Pandoc/Readers/Txt2Tags.hs
@@ -56,12 +56,13 @@ getT2TMeta = do
outp <- fromMaybe "" <$> P.getOutputFile
curDate <- formatTime defaultTimeLocale "%F" <$> P.getZonedTime
curMtime <- catchError
- ((nonEmpty <$> mapM P.getModificationTime inps) >>=
- \case
+ (mapM P.getModificationTime inps >>=
+ (\case
Nothing ->
formatTime defaultTimeLocale "%T" <$> P.getZonedTime
Just ts -> return $
formatTime defaultTimeLocale "%T" $ maximum ts)
+ . nonEmpty)
(const (return ""))
return $ T2TMeta (T.pack curDate) (T.pack curMtime)
(intercalate ", " inps) outp