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

defaultViewDate modify my input variable #2680

Open
loverg-c opened this issue Apr 25, 2023 · 0 comments
Open

defaultViewDate modify my input variable #2680

loverg-c opened this issue Apr 25, 2023 · 0 comments

Comments

@loverg-c
Copy link

Expected behaviour

When i pass a date object as an input for the defaultViewDate, this variable should not be modified when i'm changing the viewDate by switching my view manually

Actual behaviour

My input variable is changed when i'm switching the view mode manually

Step to reproduce

Given I have a datepicker
And I pass a Date variable as defaultViewDate option,
When I open the datepicker
And I click on the month view
And I click on another month than my defaultViewDate
Then my date variable has been changed

Datepicker version used

1.9.0

Example code

https://jsfiddle.net/g7r0ow4y/


I think its maybe related to this commit 8c99457 , because other case use a copy of the startDate (by doing a new Date), but not on this else.

(Maybe i'm wrong, i didn't investigate so much and i'm not used to js)

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

No branches or pull requests

1 participant