-
Notifications
You must be signed in to change notification settings - Fork 579
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
Month UNDEFINED if shortcuts and monthSelect are enabled #412
Comments
I changed a little bit as a workaround, there should be a mutator that update both of the 2 months instead of just modifying this function because it updates without this function in elsewhere. And some of the updates rendered the calendar more than once.
|
Hi @kl23 , I tried with your changes and the issue is still present, I forgot to say that the error is showing when you pick the shortcuts. |
Thanks for your reply, @XavierCLL . I in fact encountered the same problem by clicking a date range in the same month and the range is in the maximum month (i.e. The jquery-date-range-picker/src/jquery.daterangepicker.js Lines 2018 to 2028 in 23cbf1f
and it loops through the input from range created in generateMonthElement() (line 2003). The range depends on the first parameter in showMonth() and is limited by the maximum date that you can choose, thereby the list will not include Apr in case max date is Mar. But sorry, I don't understand how range is generated, you may take a look here:jquery-date-range-picker/src/jquery.daterangepicker.js Lines 1945 to 1963 in 23cbf1f
The problem is: The code changed in above comment shifted the pair of months to left (month -= 1) so that (1) the selected date range are on the right, (2) maximum date is either on the right or in the next page of right month. You may try to apply this logic to where it triggers |
https://jsfiddle.net/63ks4vbo/3/ I don't see that problem, can you show your trouble on jsfiddle ? |
I can't see an issue either. I updated the fiddle to include a moment.js library. |
ok, thanks. I guess better update docs. |
Hi @wakirin and @yphoenix you are right I forget the jsfiddle for to show the error, please go to: https://jsfiddle.net/tuteq2ae/1/ And click on a shortcut 1day or 3days |
maybe this bug is related with moment() library because if you delete the line of endDate the error disappears, the #421 fix that? |
Found problem in function
I have replaced jsfiddle with updated jquery.daterangepicker.js |
Yeah @wakirin with your changes this issue is fixed, thank you! please do the PR |
I'm re-opening this issue, because the fix presented here breaks the month dropdown. See #452. The issue is a bit more involved. The problem is that the select builder depends on the range constructed in I will open a PR with a more robust fix soon. |
@XavierCLL , please see #455 and let me know if it fixes your issue. You can test the fixed version in this JSFiddle. |
Hi @monovertex, for me works perfect, I tested here: https://jsfiddle.net/xwb62hdn/9/ thanks! |
@XavierCLL, unfortunately there was still one bug leftover. Please see this new jsfiddle. It uses the same config as in your jsfiddle, and it seems to be okay. Thanks for the help! |
The month showed as UNDEFINED if shortcuts and monthSelect are enabled:
Config:
Using jquery-date-range-picker v 0.16.1
The text was updated successfully, but these errors were encountered: