简体   繁体   English

Bootstrap DateRangePicker-如何应用日期更改

[英]Bootstrap DateRangePicker - how to apply date change

I'm adding a little extra logic to the daterangepicker ( http://www.daterangepicker.com/ ). 我在daterangepicker( http://www.daterangepicker.com/ )中添加了一些额外的逻辑。 I have some simple code to the start date when a dropdown is selected. 选择下拉列表时,我对开始日期有一些简单的代码。

The date does seem to change in the background, but only becomes visible when I close the picker and open it again. 日期似乎在后台发生了变化,但是只有当我关闭选择器并再次打开它时,该日期才可见。 I'd rather the dates update immediately. 我希望日期立即更新。 Any idea if there's a way to "refresh" the shown dates to match when setStartDate is called? 知道是否有一种方法可以在调用setStartDate时“刷新”显示的日期以使其匹配吗?

So I found a way, looking through the functions available. 因此,我找到了一种浏览可用功能的方法。 You can call the "updateView()" method to have the view change as needed. 您可以调用“ updateView()”方法以根据需要更改视图。 Sorted. 排序。

$('input[name="daterange"]').data('daterangepicker').updateView();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM