blacksmithgu / obsidian-dataview

A data index and query language over Markdown files, for https://obsidian.md/.
https://blacksmithgu.github.io/obsidian-dataview/
MIT License
7.13k stars 419 forks source link

queries with file.cday don't refresh on date rollover #1077

Open pbienst opened 2 years ago

pbienst commented 2 years ago

What happened?

I have the query below in my dashboard, to list the files that were created today.

Two issues:

1) When I leave Obsidian open overnight, in the morning the query still shows yesterday's results 2) When I make a dummy edit to the query, it updates in live preview mode. However, switching to read mode, the query still shows yesterday's results

DQL

list
from "journal work" or "zettelkasten work" or "journal home/diary"
where file.cday = date(today)
sort file.name desc

JS

No response

Dataview Version

0.4.26

Obsidian Version

0.14.9

OS

Windows

AB1908 commented 2 years ago

Does this persist on the latest beta? There is also a new refresh command from #998 that may help with this.

pbienst commented 2 years ago

Yes, the refresh command in 5.38 does not work, just checked it this morning....

AB1908 commented 2 years ago

I know too little of the plugin's structure to suggest anything so let's wait for blacksmithgu.

blacksmithgu commented 2 years ago

There is a surprisingly complicated reason for why the "Refresh" command does not work (that boils down to dates being resolved at query parse time rather than evaluation time); the fix is relatively easy, however, so I'll include this in the next release.

pbienst commented 2 years ago

Any updates on this easy fix? The latest releases still seem to have this problem... Thanks!