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

Multiple dates not work as spected #39

Closed
Isilnar opened this issue May 25, 2022 · 0 comments
Closed

Multiple dates not work as spected #39

Isilnar opened this issue May 25, 2022 · 0 comments
Labels

Comments

@Isilnar
Copy link

Isilnar commented May 25, 2022

duDatepicker version: 2.0.2

Code:
duDatepicker('#daterangemultiple', {multiple: true, i18n: 'es', format: 'dd/mm/yyyy'});
...
tmp_values = ["01/05/2022", "02/05/2022"];
...
duDatepicker('#daterangemultiple', 'setValue', tmp_values);
duDatepicker('#daterangemultiple', 'show');

Description:
I try to describe the issue, sorry for my english.
Open duDatepicker, if you click in some dates and push OK button, all works (show from console output):
{
"isTrusted": false,
"data": {
"_dates": [
"2022-05-19T22:00:00.000Z",
"2022-05-25T22:00:00.000Z",
"2022-05-27T22:00:00.000Z"
],
"dates": [
"20/05/2022",
"26/05/2022",
"28/05/2022"
]
}
}

The issue happens when you stablish some dates in JS, open duDatepicker and click OK button without clicking more dates, JS stablish dates appears selected in duDatepicker, but in this case not work, console show:
{
"isTrusted": false,
"data": {
"_dates": [],
"dates": []
}
}

Images:
First time open duDatepicker and click some dates, push OK and receive dates selected:
image
image

Then, you in your JS stablish previous selected dates and show:
tmp_values = ["20/05/2022","26/05/2022","28/05/2022"]
duDatepicker('#daterangemultiple', 'setValue', tmp_values);
duDatepicker('#daterangemultiple', 'show');

duDatepicker apears with previous dates marked:
image

But when you push OK button no dates are returned:
image

@dmuy dmuy added the bug label Jun 5, 2022
dmuy added a commit that referenced this issue Jun 5, 2022
- fixed bug: next calendar rendering
- fixed bug: year view error on multiple mode
- fixed bug: issue #39
- implemented #34
- added value checking (considers minDate, maxDate, minYear & maxYear)
@dmuy dmuy closed this as completed Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants