My daily notes contain this dataview below the YAML area:
\```dataview
List FROM ""
WHERE (created >= this.file.day + dur(10 hours))
AND (created <= this.file.day + dur(34 hours))
AND file.name!=this.file.name
SORT file.mtime asc
\```
This used to work! It gets the condition-date from the daily note’s file name, and it collects notes using the createdproperty that all my notes contain. I like this because I can easily adjust it each note using arrow keys.
Now this no longer works … except for notes that were created last month—because in these, the date string looks like this:
created: 2024-09-24T04:30:00
That is—with the “T” and the three chars for seconds (“:00”)
What’s going on? Can’t dataview “see” dates without the T and seconds added?
Things I have tried
This is a question about what formats dataview can understand.
And I guess a more fundamental question is—why did the template suddenly drop the “T” from the string it constructs when make a new note? It was never explicitly part of the template’s string-making formula, yet it was added automatically. I don’t understand.
Your created-field in format YYYY-MM-DD HH:mm is possibly normal Text to dataview, see the docs.
Try converting it into data type Date with the date function.
\```dataview
List FROM ""
WHERE (date(created) >= this.file.day + dur(10 hours))
AND (date(created) <= this.file.day + dur(34 hours))
AND file.name!=this.file.name
SORT file.mtime asc
\```
Without conversion Dataview sees it as just text when the T is missing, and this has been like that for quite some time now (as in as long as I’ve used Dataview).
So you could either add the T in your template, or possibly start using the date(text, format) command to turn the text into a date.
Support for dates was introduced in Dataview 0.1.5, released on 13 February 2021.
The readme for the release detailed using the ISO8601 date format, including the need to use T for time values. So the date / date-and-time requirements have always been the same.
date: A date and time in ISO8601 format - yyyy-mm-ddThh:mm:ss. Everything after the year and month is optional, so you can just write yyyy-mm or yyyy-mm-dd or yyyy-mm-ddThh.