Skip to content

feat: configurable dailies filename format#129

Open
chipsenkbeil wants to merge 1 commit into
mainfrom
feat/90-configurable-dailies-filename
Open

feat: configurable dailies filename format#129
chipsenkbeil wants to merge 1 commit into
mainfrom
feat/90-configurable-dailies-filename

Conversation

@chipsenkbeil

@chipsenkbeil chipsenkbeil commented Feb 20, 2026

Copy link
Copy Markdown
Owner

Merge Order

This PR is part of the dailies chain. Merge after #127 and #128.

Summary

  • Addresses How to change Dailies file name for goto lookup? #90
  • Adds extensions.dailies.date_format config option (default "%Y-%m-%d") to control strftime format for daily note filenames
  • Updates date_string(), path_to_date(), buf_to_date(), roam_dailies_files(), and roam_dailies_dates() to use the configured format
  • For custom formats, reverse-parses filenames using generated Lua patterns from the strftime format string
  • Fully backwards-compatible: default %Y-%m-%d uses orgmode's existing date parser

Test plan

  • With default config, verify all dailies functionality works as before
  • Set extensions.dailies.date_format = "%Y%m%d" and verify:
    • goto_today creates a file named 20260220.org
    • goto_next_date / goto_prev_date navigation works
    • Calendar highlights existing dates correctly
    • capture_date uses the configured format for filenames

Add extensions.dailies.date_format config option (default "%Y-%m-%d")
that controls the strftime format used for daily note filenames.

Changes:
- date_string() now takes roam param and uses configured format
- path_to_date() now takes roam param and reverse-parses custom formats
  using generated Lua patterns from the strftime format string
- buf_to_date() updated to pass roam param
- roam_dailies_files() validates filenames against configured format
- roam_dailies_dates() uses path_to_date for consistent parsing
- All call sites updated to pass roam where needed

For the default %Y-%m-%d format, behavior is fully backwards-compatible
and uses orgmode's existing date parser. Custom formats use a pattern-
matching approach that supports common strftime codes (%Y, %m, %d, etc).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant