To enable this when may be needed I always use a YYYY-MM-DD naming convention for files, titles, etc. Only easy way I know. Habitually have done this for years.
(automatically) extract the date from the title and set that date as a sortable date (e.g. the created date)
(automatically) rename your files to use the format suggested by @rmschne
Both could easily be done with a smart rule or script, if the format is always the same (that is, ends - as do your three examples above - with a date in the format dd-mm-yyyy).
Re @Blanc’s option 1 - below is a script adapted from (I think) one of DT’s stock scripts which I use to do something similar. (I can’t really script, so apologies in advance - others who can will be able to come up with a better solution).
I habitually use the YYYY-MM-DD convention like @rmschne but I often get large numbers of documents from solicitors with the document date in DD.MM.YYYY format at the end of the file name. I put it in Keyboard Maestro to set the Creation Date to the date appended to the file name. Once you have set the Creation Date (or you could use a custom data field if you don’t want to mess with the Creation Date), you can use a smart rule to rename the file using a placeholder. You could replace the “.” with “-” to fit with your naming convention.
-- Set creation date based on name "NAME DD.MM.YYYY”
tell application id "DNtp"
try
set theRecords to selected records
if theRecords = {} then error "Please select some records"
show progress indicator "Renaming... " steps (count theRecords) as string with cancel button
repeat with thisRecord in theRecords
set thisName to name without extension of thisRecord
step progress indicator thisName
set theCreationDate to creation date of thisRecord
try
set seconds of theCreationDate to 0
set minutes of theCreationDate to 0
set hours of theCreationDate to 0
set day of theCreationDate to ((characters -10 thru -9 in thisName) as string) as integer
set month of theCreationDate to ((characters -7 thru -6 in thisName) as string) as integer
set year of theCreationDate to ((characters -4 thru -1 in thisName) as string) as integer
set creation date of thisRecord to theCreationDate
end try
end repeat
hide progress indicator
on error error_message number error_number
hide progress indicator
if the error_number is not -128 then display alert "DEVONthink" message error_message as warning
end try
end tell
In addition to the ideas here about writing scripts to convert the text representations of dates into sortable information, my needs for this are mostly met when I use Hazel’s text matching and date formatting capabilities to create sortable dates on incoming files. This handy for when I’m using Hazel to pre-process “easily-automateable” invoices/bills where the files are processed (named, tagged, etc.) based on content. Yes, can use DEVONthink for that, but for pre-processing files Hazel as a file processor seems easier to me. Your mileage may be different.