Hi @upcrown ,
while the YAML format (used for frontmatter metadata) itself supports data types and supports explicit type annotations, it looks like Obsidian (at least for now) treats all values as strings (or collections of strings, etc.)
That means, even if you enforce a specific type of the metadata:
publishTime: !date 08/02/2022
birthday: !date 2020-10-11
timeoftheday: !timestamp '2023-02-07T08:30:00Z'
it is seen by Obsidian YAML parser as string, hence sorted as string.
Having the above in mind, my suggestion for now is to use a different date format in the metadata, a format which can be still sorted properly if treated as a string.
Your example uses the US date format, which is unfriendly for text-based sorting
Could you switch to ISO-alike format, where the year comes first, then month (as a number) and then the day? For example:
publishTime: 2017-12-25
This would resolve the sorting issue automatically.
If switching the date format is not feasible (for various potentials reasons), there is no simple way to sort correctly by the dates in US format (in a metadata or as part of file name) because all is string-based.
Long-term many solutions are possible on the plugin side and/or on Obsidian side
Short term: please open a new discussion in the plugin github home. Handling dates is tricky, because of the various date formats. My thinking is towards some explicit specification in sorting-spec
that a metadata contains a date (or a timestamp) plus (optionally) about the date format (taking the locale
as the default).
To recap: for now, the only way to sort by dates in metadata correctly is to use date format that allows text-based sorting, e.g. YYYY-MM-DD or YYYY/MM/DD or equivalent.