New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed zonedTimeToUtc not working with year < 100. #170
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think linting was run on this commit. eslint
barfs something about a deprecation warning:
(node:620180) [ESLINT_PERSONAL_CONFIG_SUPPRESS] DeprecationWarning: '~/.eslintrc.*' config files have been deprecated. Please remove it or add 'root:true' to the config files in your projects in order to avoid loading '~/.eslintrc.*' accidentally. (found in "../../../.eslintrc")
(Use `node --trace-deprecation ...` to show where the warning was created)
Did I do something wrong?
var tmp = new Date(0) | ||
tmp.setUTCFullYear(d.getFullYear(), d.getMonth(), d.getDate()) | ||
tmp.setUTCHours(d.getHours(), d.getMinutes(), d.getSeconds(), d.getMilliseconds()) | ||
|
||
var utc = tmp.getTime() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactor using new helper functions in tzParseTimezone
?
function calcOffset(date, timezoneString) { | ||
var tokens = tzTokenizeDate(date, timezoneString) | ||
|
||
var asUTC = Date.UTC(tokens[0], tokens[1] - 1, tokens[2], tokens[3] % 24, tokens[4], tokens[5]) | ||
var asUTC = DateUTC(tokens[0], tokens[1] - 1, tokens[2], tokens[3] % 24, tokens[4], tokens[5], 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems milliseconds are dropped here, intentional? I can write a second PR to fix that.
@make-github-pseudonymous-again thank you for working on this. I'd be happy to merge this in once completed and the conflicts resolved. |
5b0ac78
to
43a048f
Compare
@marnusw I rebased and fixed the test with the extra trailing zero. What about linting? I think the other comments I made can be addressed in a different PR. |
Released in |
Fixes #87.