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

maDateField timezone adjustment. Fixes #1271 #1305 #1317

Closed
wants to merge 1 commit into from

Conversation

matheo
Copy link
Contributor

@matheo matheo commented Mar 8, 2017

There's an infinite loop $watching value and rawValue, because the Date object adjust the yyyy-mm-dd value to the user's timezone, then modifying the original value +- the timezone. This patch adjust the timezone, so the rawValue is kept as the original value.

Copy link
Contributor

@jpetitcolas jpetitcolas left a comment

Choose a reason for hiding this comment

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

Can you add a test to prove your fix? :)

@Kmaschta Kmaschta self-assigned this Mar 8, 2017
@Kmaschta
Copy link
Contributor

Kmaschta commented Mar 8, 2017

There is an infinite loop, but it isn't due to the timezone but by a circular watch between two fields of the same scope.

I fix it with the PR #1318, which supersede this one.

Thanks for contributing!

@Kmaschta Kmaschta closed this Mar 8, 2017
@matheo
Copy link
Contributor Author

matheo commented Mar 8, 2017

Infinite loop caused by the timezone changing the original value, indeed, inside the circular watch. Once Date() changes the rawValue, it's all messed up, but the angular.equals check seems legit to prevent that too.

I confirmed that 1.0.1 works, thanks a lot!
Best regards

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.

3 participants