Calculating the Difference between Two Dates in JavaScript