We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Hello there!
Lets imagine I have 2 inputs fields using the datetimepicker.
One field is the start and the other the end field. Both fields can be changed without the "onSelect" event by changing the input date directly.
This will then cause the on change. on change we are doing a reset of minDate and maxDate.
And now the problem happends. setting minDate and maxDate is again triggering the on change event and so it causes a endless recursion.
how can i avoid that?
it seems this ticket is exactly the same problem: #672
can this be fixed? is there any workaround? can i forbid to call "change"-event somehow?
this is my code:
HTML:
<input class="dtp_fake_start" value="" type="text"> <input class="dtp_fake_end" value="" type="text">
JS
$(".dtp_fake_start").datetimepicker({ timeFormat: ezdatetime_time_format_string, hour: 19, minute: 30, onSelect: function(selected) { var end_date_field = $(this).closest(".editform").find(".dtp_fake_end"); end_date_field.datetimepicker("option","minDate", selected); ........... }, onClose: function(dateText, inst) { ...... } }).on("change", function () { $(this).closest(".editform").find(".dtp_fake_end").datetimepicker("option","minDate", $(this).val()); }); $(".dtp_fake_end").datetimepicker({ timeFormat: ezdatetime_time_format_string, hour: 19, minute: 30, onSelect: function(selected) { if( $(this).closest(".editform").find(".dtp_fake_start").datetimepicker('getDate') != null ) { $(this).closest(".editform").find(".dtp_fake_start").datetimepicker("option","maxDate", selected); } } }).on("change", function () { $(this).closest(".editform").find(".dtp_fake_start").datetimepicker("option","maxDate", $(this).val()); });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hello there!
Lets imagine I have 2 inputs fields using the datetimepicker.
One field is the start and the other the end field.
Both fields can be changed without the "onSelect" event by changing the input date directly.
This will then cause the on change. on change we are doing a reset of minDate and maxDate.
And now the problem happends. setting minDate and maxDate is again triggering the on change event and so it causes a endless recursion.
how can i avoid that?
it seems this ticket is exactly the same problem: #672
can this be fixed? is there any workaround? can i forbid to call "change"-event somehow?
this is my code:
HTML:
JS
The text was updated successfully, but these errors were encountered: