Skip to content

Commit

Permalink
Fix potential issues for the future (#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
The1Penguin authored Nov 13, 2024
1 parent ea3a4a2 commit 829e530
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Model/Linsen.hs
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,11 @@ parse day =
(.: "children")
>=> (\case
[] -> fail "Failed to index into richtext"
(v:_) -> pure v)
v -> pure $ mconcat v)
>=> (.: "text")
>=> filterM (pure . not . isSpace)
>=> \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
Expand Down

0 comments on commit 829e530

Please sign in to comment.