chore(lms): minor changes
This commit is contained in:
parent
eeb22dec97
commit
f9fb236025
@ -1066,6 +1066,8 @@ dbTable PSValidator{..} dbtable@DBTable{ dbtIdent = dbtIdent'@(toPathPiece -> db
|
|||||||
<|> piInput
|
<|> piInput
|
||||||
|
|
||||||
psShortcircuit <- (== Just dbtIdent') <$> lookupCustomHeader HeaderDBTableShortcircuit
|
psShortcircuit <- (== Just dbtIdent') <$> lookupCustomHeader HeaderDBTableShortcircuit
|
||||||
|
lch <- lookupCustomHeader HeaderDBTableShortcircuit
|
||||||
|
$logErrorS "DBShortcircuit" $ fromMaybe mempty lch <> " and also " <> tshow psShortcircuit
|
||||||
|
|
||||||
let
|
let
|
||||||
-- adjustPI = over _piSorting $ guardOnM doSorting -- probably not neccessary; not displaying the links should be enough for now
|
-- adjustPI = over _piSorting $ guardOnM doSorting -- probably not neccessary; not displaying the links should be enough for now
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import Database.Persist.Sql
|
|||||||
import qualified Database.Esqueleto.Legacy as E
|
import qualified Database.Esqueleto.Legacy as E
|
||||||
import qualified Data.Csv as Csv
|
import qualified Data.Csv as Csv
|
||||||
import qualified Data.Time.Format as Time
|
import qualified Data.Time.Format as Time
|
||||||
|
import Data.Time.Format.ISO8601 (iso8601ParseM)
|
||||||
import Utils.Lens.TH
|
import Utils.Lens.TH
|
||||||
|
|
||||||
newtype LmsIdent = LmsIdent { getLmsIdent :: Text }
|
newtype LmsIdent = LmsIdent { getLmsIdent :: Text }
|
||||||
@ -54,7 +55,7 @@ instance Csv.FromField LmsBool where
|
|||||||
parseField i
|
parseField i
|
||||||
| i == "0" = pure $ LmsBool False
|
| i == "0" = pure $ LmsBool False
|
||||||
| i == "1" = pure $ LmsBool True
|
| i == "1" = pure $ LmsBool True
|
||||||
| otherwise = empty
|
| otherwise = mempty
|
||||||
|
|
||||||
-- | LMS interface requires day format not compliant with iso8601
|
-- | LMS interface requires day format not compliant with iso8601
|
||||||
newtype LmsDay = LmsDay { lms2day :: Day }
|
newtype LmsDay = LmsDay { lms2day :: Day }
|
||||||
@ -76,4 +77,5 @@ instance Csv.FromField LmsDay where
|
|||||||
parseField i = do
|
parseField i = do
|
||||||
s <- Csv.parseField i
|
s <- Csv.parseField i
|
||||||
d <- Time.parseTimeM True Time.defaultTimeLocale lmsDayFormat s
|
d <- Time.parseTimeM True Time.defaultTimeLocale lmsDayFormat s
|
||||||
|
<|> iso8601ParseM s -- Know-How AG considers supplying iso8601 dates in the future
|
||||||
return $ LmsDay d
|
return $ LmsDay d
|
||||||
|
|||||||
Reference in New Issue
Block a user