What I’m trying to do
This is my current set-up:
- I am using the Linter plugin to automatically attach creating and last modified dates to my notes. I found this can be really important during lectures i my Uni, as I can quickly access the files I recently edited on connected topics - This works as expected.
- I then have a note block in my main JSON canvas, with a dataview, not dataviewjs query, that puts these last edited files into a table in order of last edited - This is where my issue is.
The query in question is this one below:
TABLE date(file.frontmatter.date_modified, "MM.dd.yyyy HH:mm:ss") AS "Last Changed" SORT date(file.frontmatter.date_modified, "MM.dd.yyyy HH:mm:ss") DESC LIMIT 15
Now generally this works. However, it seems as it’s not consistent with formating the minutes of the queries correctly, or more precisely it always displays the minutes as :04 no matter what the note contents actually are.
For example, if the in-file frontmatter is:
date_modified: 04.04.2024 14:20:22
Then the entry in the dataview table will display:
2024-04-04, 14:04
In some cases this seems to cause incorrect ordering of files edited in the last hour, or at most it works, but it isn’t consistent.
Things I have tried
Im not sure if this is some inconsistency between the moment.js date format that Linter uses and the luxon format that dataview uses.
However, I have tired trying different configurations, of padded and unpadded values, different date values or formats in general, and all of them produce the same output.
My current Linter date format is the following:
MM.DD.YYYY HH:mm:ss
I have also tried to pass different formats into the date() function of dataview, these either resulted in the same output, of the inability to parse the date. Sorting by the text value of the frontmatter property also doesn’t seem to produce the correct ordering.
I’ve also tried changing the property type to date & time, but that seems to encounter issues with the Linter plugin, as it doesn’t actually set the property correctly.
Does anyone have any ideas on how to make this work properly? Is there something I missed in the DataView or Linter documentation, I think I went through them well enough.
Any help would be appreciated. Thank you all in advance!