You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been playing around with some custom javascript code lately and stumbled upon this strange sorting phenomenon:
(2022-12-05 Monday sorted before 2022-12-04 Sunday)
This is the code that produces the results (in a ```dataviewjs block):
... and this is the folder structure of my daily notes, and a typical frontmatter for each daily note:
It seems that the default sorting algoritm used by dv.pages() doesn't work as expected (sorting by name, path, date, cdate, mdate would all return the correct order). No matter what I've tried putting in the debug sort field, it never seems to correct the mistake either.
Perhaps related: I've had some trouble with the dv.pages() not returning all of my daily notes upon reboot of Obsidian. Only a few pages are returned, and in very scrambled order. Several "Force Reload"s improve the return, one by one, up until the point where only the above date seems to be wrong.
Issue seems to arise primarily when I update my custom js files. I access those files in this way:
... making me think it might be related.
Does dataview get affected by a lot of files/code being loaded at boot? Am I missing something basic here?
Thanks for any and all answers :)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I've been playing around with some custom javascript code lately and stumbled upon this strange sorting phenomenon:

(2022-12-05 Monday sorted before 2022-12-04 Sunday)
This is the code that produces the results (in a ```dataviewjs block):

... and this is the folder structure of my daily notes, and a typical frontmatter for each daily note:


It seems that the default sorting algoritm used by dv.pages() doesn't work as expected (sorting by name, path, date, cdate, mdate would all return the correct order). No matter what I've tried putting in the debug sort field, it never seems to correct the mistake either.
Perhaps related: I've had some trouble with the dv.pages() not returning all of my daily notes upon reboot of Obsidian. Only a few pages are returned, and in very scrambled order. Several "Force Reload"s improve the return, one by one, up until the point where only the above date seems to be wrong.
Issue seems to arise primarily when I update my custom js files. I access those files in this way:

... making me think it might be related.
Does dataview get affected by a lot of files/code being loaded at boot? Am I missing something basic here?
Thanks for any and all answers :)
Beta Was this translation helpful? Give feedback.
All reactions