Fixed date comparison to use getTime()