Skip to content

Commit

Permalink
Flexible daily note parser
Browse files Browse the repository at this point in the history
Resolves #395
  • Loading branch information
srid committed Dec 11, 2022
1 parent d2a6423 commit 465a22b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
- Reduce Emanote's Nix runtime closure size
- UI
- Add source map for Stork [\#391](https://github.com/EmaApps/emanote/pull/391)
- Features
- Timeline backlinks recognize flexible daily notes suffixed with arbitrary string [\#395](https://github.com/EmaApps/emanote/issues/395)
- Misc
- Ignore toplevel `flake.{nix,lock}` by default.
- Remove deprecated `_emanote-bin/compile-css` script
Expand Down
2 changes: 1 addition & 1 deletion emanote.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: emanote
version: 1.0.1.3
version: 1.0.1.4
license: AGPL-3.0-only
copyright: 2022 Sridhar Ratnakumar
maintainer: srid@srid.ca
Expand Down
4 changes: 4 additions & 0 deletions src/Emanote/Model/Calendar.hs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,9 @@ parseRouteDay =
void $ M.string "-"
-- Day
day <- asInt =<< replicateM 2 M.digitChar
-- Optional suffix (ignored)
void $ optional $ do
void $ M.oneOf ['-', '_', ' ']
void M.takeRest
maybe (fail "Not a date") pure $
fromGregorianValid year (fromInteger month) (fromInteger day)

0 comments on commit 465a22b

Please sign in to comment.