I just noticed that obsidian has a strange way of sorting when it comes to showing date in a european style.
This happens when I use a dataviewjs script but also with the new base.
I am sorting my notes by modified date, but the way I write my date this happens for example:
Filename - modified date
Note XY - 20.07.25
Note XX - 21.08.25
Note YY - 22.07.25
so although the note from the 21st of August should be on top or bottom it´s between the 20th and the 22nd of july
Maybe it´s possible to change somewhere how the calendar date is interpreted?
And please don´t bark on me - but that´s the way we write our date here
This happens because the dates get compared as strings and not as dates, so you ether transform them to dates or change the order so the comparison as string works.
A possible solution could look like this:
let a = ["20.07.25", "21.08.25", "22.07.25" ]
.sort((a,b) => {
a = a.split(".");
b = b.split(".");
return Number(a[2] + a[1] + a[0]) - Number(b[2] + b[1] + b[0]);
}
)
this assumes that the format stays the same and wouldn’t work if for example the year has sometimes four digits and other times two.
Thanks very much for your effort, but unfortunately thats not a real solution to me because it seems like way too much work for hundreds of notes to be sorted.
also I think this would have no impact when it comes to sorting with bases (which will be the future)
but changing the date from strings to date seems pretty obvious!
only problem: when I do this, the date also changes. e.g. from 16.09.25 to 25.09.2016
let a = ["20.07.25", "21.08.25", "22.07.25" ]
.map(d => {
d = d.split(".").map(i => Number(i));
return new Date(2000 + d[2], d[1] - 1, d[0] + 1)//.toISOString().slice(0,10); to convert it to a bases supportet format
}).sort()
But anyways I found a different solution:
Don´t know why, but I changed the format from my daily notes, from my templates and also at dataview and now everything works fine for me (for the moment!)
but key was also to change the modified date from strings to date! so thanks again for that!