Skip to content

Commit

Permalink
Linsen lieks changing their "api" (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
The1Penguin authored Nov 9, 2024
1 parent ac064ce commit ea3a4a2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Model/Linsen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ parse day =
(v:_) -> pure v)
>=> (.: "text")
>=> \s ->
let sameDay = pure day == parseTime swedishTimeLocale "%A %d-%m-%Y" s
let sameDay = pure day == parseTime swedishTimeLocale "%A %d-%m-%Y" s ||
pure day == parseTime swedishTimeLocale "%d-%m-%Y" s
in if | sameDay && length v' >= 9 -> pure v'
| sameDay -> pure mempty
| otherwise -> fail "Unable to parse day"))
Expand Down Expand Up @@ -152,8 +153,8 @@ parse day =
$ (.: "children")
>=> \case
[] -> pure mempty
vs -> strip . replace "/ " ", "
<$> last vs .: "text"
vs -> strip . replace "/ " ", " . mconcat
<$> mapM (.: "text") vs

fetchAndCreateLinsen
:: (MonadIO m, MonadThrow m)
Expand Down

0 comments on commit ea3a4a2

Please sign in to comment.