Improved date comparison