Closed compwron closed 8 years ago
Can you explain what this PR fixes?
Basically, I ended up in a project that used this code sample copy-pasted, and ended up with off-by-one-hour errors that seemed to only happen in the afternoon PST (I'm guessing that's when Greenwich passed into a different date, causing some havoc). I traced it down to the fact that the getTimezoneOffset
function returned different values for utc
and the v
value passed into updateDate
.
I haven't gotten it down to exact reproducible steps on my browser, but trusting the passed in value's own timezone offset seems like the right call in any case.
Thanks. This commit in this PR had some whitespace issues so I made the change in a separate commit.
:+1:
I do have my editor set to auto-delete trailing whitespace. I didn't notice that when I made the PR, sorry.
Credit to @rkofman for finding the bug