death-to-ie11 icon indicating copy to clipboard operation
death-to-ie11 copied to clipboard

Clock is messed up now that ie is dead

Open connorjclark opened this issue 2 years ago • 3 comments

The year bit jumps around a lot :)

connorjclark avatar Jun 15 '22 19:06 connorjclark

I can't replicate the issue, can you provide the following: a Screenshot / screen share video, your browser + browser version please.

gabLaroche avatar Jun 16 '22 15:06 gabLaroche

It's not related to browser version, but something odd going on around T=0 (and maybe other times?). I can repro like this:

  1. store calculateProperTime on window.calculateProperTime (debugger stuff)
  2. ran calculateProperTime(4) ; extendedTimer.textContent in console
image

The issue is that parseInt seems to be unnecessary in most places (or all?) it is being used, since the inputs are numbers and not strings. If you want to round to an int than Math.floor is what you want.

image image

That's because parseInt will coerce the input into a string first, and then run the string parsing algorithm.

(also other places, like let timeRemaining = parseInt((endDate - startDate) / 1000); and let timeSince = parseInt((startDate - endDate) / 1000); )

connorjclark avatar Jun 16 '22 19:06 connorjclark

Thank you for the additional information, I'll look into it.

gabLaroche avatar Jun 16 '22 19:06 gabLaroche