fix Journal: search by title with spaces not hyphens

- ParseNote converts filename hyphens to spaces in title
- Search pattern must use spaces: 'thursday 6 november 2025'
- Restore regex search capability with correct pattern
- Fixes Journal <date> to find all entries for that date
This commit is contained in:
Levi Neely 2025-11-05 19:11:01 +01:00
parent 2ddf848853
commit 311aafbaa4
1 changed files with 4 additions and 3 deletions

View File

@ -92,9 +92,10 @@ func main() {
}
// Find journal entries for target date by searching title
// Title format: "Wednesday 5 November 2025 11:01"
// Search pattern: "wednesday-5-november-2025" (date only, no time)
titlePattern := strings.ToLower(targetDate.Format("monday-2-january-2006"))
// Title format in file: "Wednesday 5 November 2025 11:01"
// Title in Note struct: "wednesday 5 november 2025 1101" (hyphens converted to spaces)
// Search pattern: "wednesday 5 november 2025" (date only, no time, with spaces)
titlePattern := strings.ToLower(targetDate.Format("Monday 2 January 2006"))
titleFilter, _ := denote.ParseFilter(fmt.Sprintf("title:/%s/", titlePattern))
tagFilter, _ := denote.ParseFilter("tag:journal")