Make date sorting work in php
Implement date sorting