Obsidian date property breaks Dataview?

There’s something weird going on with how Obsidian is treating dates when they’re entered as properties. I don’t know what it is yet but I’m pretty sure I don’t like it.

Let’s say you have a daily note with a key named “DailyDate,” which is just the date of the note. As a property, Obsidian treats DailyDate as a date field. So for today, the name of your file is “2024-01-22” and the value of “DailyDate” is “2024-01-22.”

This DV query should evaluate to true:

=date(this.DailyDate) = date(this.file.name)

Here’s where things get weird: it evaluates correctly when you enter DailyDate as source (or from an external text editor). If you enter the date through the properties interface - which ‘tells’ DV that it’s a date - this query evaluates to false. I’ve repeated this dozens of times: keep the note open, change the date in an external editor, and it flips back to true. The behavior stays the same if you don’t enclose DailyDate in date().

There are places where DV plays around with the underlying markdown to align it with how it treats properties, once you change back to the properties interface. If you’re in source and you enter a string for a list property, and then you play around with it through the properties interface, it will convert that string into list format, and specifically bullets (it’ll even do the same thing if you enter a list using brackets then play around with it!)

That is not what is happening here with date fields. There is no change to the underlying markdown file. This is something that’s happening inside Obsidian.

I’m not able to reproduce this in any way, other than if you don’t change the query, reload the file, or rebuild the view, the query result is cached and keeps the previous value.

Just ran through it again. See attached. In the first screencap, everything was done through the external editor. In the second, the frontmatter was rewritten using the properties interface.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.