You can try ORDER BY (done asc, aux desc) , where aux is computed using CASE to get either a priority or a date based on the done value (you may have to refer them to the same type to match a single expression, e.g. , indicate the date on a suitable integer day).
For instance:
SELECT * FROM tab ORDER BY done desc, case done when 0 then prio else to_days(thedate) end desc;
source share