For long lists of notes this could get very very expensive.
First sort based on datetime, and then based on filename.