[英]Disable all dates in datetime range picker
I am using a datetime range picker as given here .我正在使用此处给出的日期时间范围选择器。 In some scenarios, I need only start-time and end-time dropdowns.
在某些情况下,我只需要开始时间和结束时间下拉列表。 Is it possible to disable all dates shown in the calendar or hide the calendar?
是否可以禁用日历中显示的所有日期或隐藏日历? I also want to remove the label displayed before the "Cancel" and "Apply" buttons.
我还想删除“取消”和“应用”按钮之前显示的标签。 Does anyone know how to do this?
有谁知道如何做到这一点?
I am using JQuery to hide the calendar but not sure whether this is the right way to do it.我正在使用 JQuery 来隐藏日历,但不确定这是否是正确的方法。
# Hide Calendar
$(".calendar-table").hide();
# Hide label that is displayed before "Cancel" and "Apply" buttons.
$(".drp-selected").hide();
According to official doc根据官方文档
autoApply: (true/false) Hide the apply and cancel buttons, and automatically apply a new date range as soon as two dates are clicked. autoApply: (true/false) 隐藏应用和取消按钮,并在点击两个日期后自动应用新的日期范围。
show.daterangepicker: Triggered when the picker is shown show.daterangepicker:显示选择器时触发
$('#daterangepicker').daterangepicker({
"autoApply": true,
}).on('show.daterangepicker', function (ev, picker) {
picker.container.find(".calendar-table").hide();
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.