我使用Bootstrap 3 DateTimePicker,我想示例8(鏈接datetimepicker)。引導3 datetimepicker事件沒有發射
的Javascript
$('#dpStart').datetimepicker({
pickDate: true, //en/disables the date picker
pickTime: false,
format: "DD-MM-YYYY",
useMinutes: false, //en/disables the minutes picker
useSeconds: false
});
$('#dpEnd').datetimepicker({
pickDate: true, //en/disables the date picker
pickTime: false,
format: "DD-MM-YYYY",
useMinutes: false, //en/disables the minutes picker
useSeconds: false
});
$("#dpStart").on("dp.change", function(e) {
alert('hey');
$('#dpEnd').data("DateTimePicker").setMinDate(e.date);
});
$("#dpEnd").on("dp.change", function(e) {
$('#dpStart').data("DateTimePicker").setMaxDate(e.date);
});
HTML
<div class="row">
<div class="col-md-6 col-sm-6 form-group">
<label for="txtStartDate">
Start Date-Time</label>
<div class="input-group date" id="dpStart" data-date-format="DD-MM-YYYY">
<asp:TextBox ID="txtStartDate" runat="server" CssClass="form-control"></asp:TextBox>
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
<div class="col-md-6 col-sm-6 form-group">
<label for="txtEndDate">
End Date-Time</label>
<div class="input-group date" id="dpEnd" data-date-format="DD-MM-YYYY">
<asp:TextBox ID="txtEndDate" runat="server" CssClass="form-control"></asp:TextBox>
<span class="input-group-addon"><span class="glyphicon glyphicon-calendar"></span>
</span>
</div>
</div>
</div>
日曆顯示是按需求而像dp.change,dp.hide事件,dp.show都沒有啓動起來.. 可能是什麼問題呢?任何幫助?
編輯: 請注意,我已經包括像引導JS,CSS引導,Moment.js和的DateTimePicker JS和CSS文件的所有必要的文件。
你可以在你的插件裏面做一個小提琴嗎? – pbenard
我試圖讓小提琴,但我不能添加引導功能,它? – writeToBhuwan
你有骨架曾經存在像:http://jsfiddle.net/brainbolt/52VtD/4/ – pbenard