A callback passed to the sort function should return a positive number if the first argument is strictly greater than the second (according to your sorting needs), a negative number if it's smaller, and 0 if they're equivalent.
You're not doing this. You're just returning whether the first argument is greater then the second. In short, you're returning a boolean, which is converted then into a number where true == 1 and false == 0.
In other words, you never return a negative value when it's needed, and this causes the issue.
Try this:
return date1 - date2;
It's a common trick for numeric sorting.