Skip to content
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

[bugfix] Fix the bug of repeatedly setting weekYear (number) #5568

Closed
wants to merge 2 commits into from

Conversation

Alanscut
Copy link
Contributor

@Alanscut Alanscut commented May 28, 2020

fixes #3944

Changes

Test plan

src/test/moment/week_year.js

@coveralls
Copy link

Coverage Status

Coverage increased (+0.03%) to 88.525% when pulling e24a899 on Alanscut:issue_3944 into 82d6c1a on moment:develop.

@marwahaha marwahaha changed the title [bugfix]Fix the bug of repeatedly setting weekYear (number) [bugfix] Fix the bug of repeatedly setting weekYear (number) May 28, 2020
hooks.isMoment(this)
) {
var createFunc = this._isUTC ? hooks.utc : hooks;
this._d = createFunc(this._i, this._f, this._strict)._d;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this work?

@ichernev
Copy link
Contributor

Fixed in #6193. I didn't understand this fix, and it's a bit scary...

@ichernev ichernev closed this Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

weekYear(Number) jumps to the previous day of the week (and wraps around)
4 participants