less verbose version of dateSort function