This sorting logic looks impressive.
So does this custom date parser.
But the language already has one.
Rewriting standard functionality adds risk without real benefit.
Built-in libraries are tested, optimized and familiar to other developers - your custom version usually isn't.
Rule of thumb:
If the language already solves it, use that.
Next Topic: Tautological (Useless) Comments