This may be a stupid question, but is there a way, ideally without plugins, to sort by date the sidebar notes?
What I’m trying to do
I’ve change the date format to DD-MM-YYYY as it’s the correct format for dates but now in the sidebar sorting is lexicographical which is not great for dates
I would like to be able to sort but oldest/newest based on the title date.
Things I have tried
I’ve googled and looked in the forum and help but I can find an answer.
Using the ISO8601 format, YYYY-MM-DD, will sort “correctly”, and this is the format recognised by multiple plugins and so on.
I’m pretty sure that the answer is ‘no’.
Whilst I also like to read dates as DD-MM-YYYY in text, I strongly believe that when used as, or in, a filename, the best format is YYYY-MM-DD. One obvious reason is that the file-system/s of (I’d guess) all operating systems displays them in date order.
There may be an alternate idea where you name the file with the format you like: DD-MM-YYYY but add a filename prefix that more simply represent the date in numeric form. Unix timestamp perhaps. This would sort the files in date order, include your preferred date format in the name and include a prefix that ostensibly looks meaningless and so might not be annoying to see.
It might look something like this:
1688625414 - 06-06-2023 (6th June 2023)
But my advice would be to learn to like, if not love, the YYYY-MM-DD format!
You can only sort by file name (A–Z or Z–A), modified time, or created time, so what you are seeing is expected.
For maximum functionality (especially with queries, plugins, and even sharing data with other apps) use the internationally supported ISO 8601 format for dates. What you use now looks like a date to you but a computer sees it as a string of numbers that could mean anything.
EDIT: I was typing at the same time as the two posters above. Leaving this here with the ISO link for the OP.
Something else you could consider is to ‘file’ daily files into Monthly folders.
I did set up something like this a while ago and so know it’s possible. Ultimately I found it annoying and now just use YYYY-MM-DD with files all in one folder.
In the Daily Notes setting, when defining the filename format, you can include folder/s. This can be used to, for example, file all files by month. Giving something like:
06 - June/
07 - July/
That would allow sorting of files in ‘your’ format - but only with the month they are a part of.
Learning to love YYYY-MM-DD is still, I think, your best option!
You’d need to think about years, and perhaps have yearly folder too, or turn the monthly folders into this sort of format: 2023-06, 2023-07.
I agree with @_Dan.
Date format I use in the
Daily notes settings is:
When a new note is created, the system generates folders for the year and then the month nested inside the year (YYYY/MM/), with the daily notes being created inside the folder for the right month (YYYY-MM-DD).
So my journal has a directory of files by year and month without ever having to create a folder manually.
I’m sorry, but the correct format is YYYY-MM-DD, as others here (and xkcd) have noted.
Thanks all for your answers!! unfortunately it looks that my specific problem does not have a solution…
I am aware that the preferred way is YYYY-MM-DD but i really dislike it
For reference, as a workaround Im sorting by creation date and that somewhat works.
Change your config so that your daily files are created in monthly folders. Daily files then named as you like: DD-MM-YYYY will be sorted in date order - within the month that they belong to. The inconvenience (if it is one) of having daily files in monthly folders would surely be worth it over the ‘bodge’ of sorting by creation date… don’t you sometimes create a daily file for a future date ahead of time?
Just be sure to name your monthly folders sensibly or your months will be out of whack!
YYYY-MM seems sensible.
Or even months within years as eightnig (above) demonstrated:
The sorting takes care of itself.
While not a direct solution to your request, I hope you will give my plugin Daily Note Outline a try from community plugin list. It is a plugin that arranges multiple daily notes in chronological order and displays the outline all at once (or simply a list of chronological daily notes if you hide all outline elements).