Skip to content

fix: expand org-mode date specifiers in daily templates#127

Open
chipsenkbeil wants to merge 1 commit into
mainfrom
fix/68-daily-template-date-expansion
Open

fix: expand org-mode date specifiers in daily templates#127
chipsenkbeil wants to merge 1 commit into
mainfrom
fix/68-daily-template-date-expansion

Conversation

@chipsenkbeil

@chipsenkbeil chipsenkbeil commented Feb 20, 2026

Copy link
Copy Markdown
Owner

Merge Order

This PR is part of the dailies chain. Merge first (before #128 and #129).

Summary

  • Fixes Daily templates adjust template variables only partially #68
  • format_date() only matched %<FORMAT> patterns. Org-mode date shortcuts %t, %T, %u, %U were left unexpanded, resolving to "today" instead of the target date
  • Extends format_date() to replace these org capture template codes using the target date's OrgDate object

Test plan

  • Create a dailies capture template with %u in the title and %<...> in the body
  • Use capture_date for a non-today date
  • Verify both the title and body show the target date, not today's date

format_date() only matched %<FORMAT> patterns via string.gmatch. Org-mode
date shortcuts %t, %T, %u, %U were left unexpanded, resolving to "today"
instead of the target date when using capture_date for a non-today date.

Extend format_date() to replace these org capture template codes using
the target date's OrgDate object:
- %t → inactive date stamp [YYYY-MM-DD Day]
- %T → active date stamp <YYYY-MM-DD Day>
- %u → inactive date+time stamp [YYYY-MM-DD Day HH:MM]
- %U → active date+time stamp <YYYY-MM-DD Day HH:MM>
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.

Daily templates adjust template variables only partially

1 participant