Add periodic-note formats: week/month/quarter/year granularity - #50
Merged
Conversation
New optional settings (weekFormat/monthFormat/quarterFormat/yearFormat,
all empty/disabled by default): when an expression resolves to a whole
period instead of a single day -- "next week", "this quarter", "Q3",
"Q3 2026", "2026-W02" -- use that format (e.g. "GGGG-[W]WW", "YYYY-[Q]Q")
instead of the daily Date format, for linking to Periodic Notes-style
weekly/monthly/quarterly/yearly notes.
Parser: NLDParser.getParsedPeriod() detects granularity via
"this/next/last week|month|quarter|year" (both word orders -- French
postposes the prefix) plus language-neutral explicit Q3/2026-Q3/2026-W02
forms, falling back to getParsedDate() (day granularity) otherwise.
getParsedDateRange() tags its existing "next week" result with
granularity: "week" so getParseCommand() can prefer the single
weekFormat value over the existing 7-day link list when configured,
without touching that list's default behavior.
Added a "quarter" vocabulary entry to all 12 language dictionaries.
Verified empirically per language (not just combined), which caught two
pre-existing gaps along the way: French's noun-before-adjective order
("semaine prochaine") wasn't matched by the prefix-first regex, and
Dutch was missing the neuter grammatical forms ("volgend"/"vorig")
needed before "jaar"/the new "kwartaal".
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011AnUmNKkH1y4ZAEPKF1WwQ
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
This was referenced Aug 1, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #49. Implements the full ("option 2") scope: not just week formats (as proposed in the referenced upstream PR/issue), but week and month and quarter and year, with granularity detection built into the parser rather than a single hardcoded case.
New optional settings (Settings → Periodic notes), each empty/disabled by default:
weekFormat(e.g.GGGG-[W]WW)monthFormat(e.g.YYYY-MM)quarterFormat(e.g.YYYY-[Q]Q)yearFormat(e.g.YYYY)When an expression resolves to a whole period instead of a single day —
@next week,@this quarter,@Q3,@Q3 2026,@2026-W02— the corresponding format is used instead of the daily Date format, for linking to Periodic Notes-style weekly/monthly/quarterly/yearly notes. Leaving a field empty keeps existing behavior unchanged, including@next week's current behavior of inserting a link for every day of the week (backward compatible, opt-in).Implementation
NLDParser.getParsedPeriod()(new): detects granularity viathis/next/last week|month|quarter|yearin all 12 languages (both word orders — French postposes the prefix, e.g. "la semaine prochaine") plus language-neutral explicit forms (Q3,Q3 2026,2026-Q3,2026-W02). Falls back to the existinggetParsedDate()(day granularity) for everything else — the existing day-granularity path is untouched.getParsedDateRange()now tags its existing "next week" result withgranularity: "week", sogetParseCommand()can prefer the singleweekFormatvalue over the existing 7-day link list when configured, without changing that list's default behavior whenweekFormatis empty.quartervocabulary entry to all 12 language dictionaries (en/fr/es/it/de/pt/ru/uk/nl/ja/zh/ko).Bugs found along the way (via empirical per-language verification)
Per this repo's CLAUDE.md rule ("verify empirically per language, not just read the code"), I wrote per-language regression tests for all 12 languages before considering this done — that caught two pre-existing gaps unrelated to the new feature itself:
next/lastonly had the common-gender forms ("volgende"/"vorige"), missing the neuter forms ("volgend"/"vorig", no final "-e") needed before neuter nouns like "jaar" and the newly-added "kwartaal". Added the missing forms.Verification
parseDate()granularity-format integration,getParseCommand()week-format-vs-list-behavior, settings UI).npx tsc --noEmit,npx eslint, andnpm run buildall clean.Generated by Claude Code