无法在 jquery 日期范围选择器上触发事件?
unable to trigger a event on jquery daterange picker?
我正在使用 jquery 日期范围选择器,但找不到给我选定日期范围的事件。
这是我的日期选择器的样子
https://snag.gy/SqiOPK.jpg
html
<div id="example-advanced-daterangepicker" data-step="1" data-intro="This is a date range selector!">
<i class="fa fa-calendar"></i>
<span>April 6, 17 - April 6, 17</span>
<b class="caret"></b>
</div>
我查看了 this URL 以找到您的解决方案。
我在那里找到了一些用于指定选定日期范围的事件。
getValue (Function)
您可以在日期范围选择器触发的事件中调用此函数。喜欢,
.bind('datepicker-change',function(event,obj)
{
// It will fire while selecting date range from the picker. SO you can set your code here something to get selected date range
console.log(obj); // By using this object you will sure find some solution to get a range between two dates.
date1: (Date object of the earlier date)
date2: (Date object of the later date),
}
如需更多帮助,您可以查看this URL。这对你有帮助。谢谢
我正在使用 jquery 日期范围选择器,但找不到给我选定日期范围的事件。
这是我的日期选择器的样子 https://snag.gy/SqiOPK.jpg
html
<div id="example-advanced-daterangepicker" data-step="1" data-intro="This is a date range selector!">
<i class="fa fa-calendar"></i>
<span>April 6, 17 - April 6, 17</span>
<b class="caret"></b>
</div>
我查看了 this URL 以找到您的解决方案。
我在那里找到了一些用于指定选定日期范围的事件。
getValue (Function)
您可以在日期范围选择器触发的事件中调用此函数。喜欢,
.bind('datepicker-change',function(event,obj)
{
// It will fire while selecting date range from the picker. SO you can set your code here something to get selected date range
console.log(obj); // By using this object you will sure find some solution to get a range between two dates.
date1: (Date object of the earlier date)
date2: (Date object of the later date),
}
如需更多帮助,您可以查看this URL。这对你有帮助。谢谢