繁星淼淼
2023-09-28 16:12:09
您好,我已經(jīng)在我的網(wǎng)站上添加了引導(dǎo)程序datetimepicker,但它似乎不起作用。我是不是錯(cuò)過(guò)了什么?或者做錯(cuò)了什么?請(qǐng)幫忙。該控件處于引導(dǎo)模式,但據(jù)我所知,它不會(huì)限制您的可訪問(wèn)性,這是我能想到的它不起作用的唯一原因......這是我有的參考資料:<link rel="stylesheet" href="css/bootstrap.css" /><link rel="stylesheet" href="css/bootstrap.min.css" /><link rel="stylesheet" href="css/bootstrap-select.min.css" /><link rel="stylesheet" href="css/jquery.bootstrap-touchspin.min.css" /><link rel="stylesheet" href="css/jquery.contextmenu.min.css" /><link rel="stylesheet" href="css/style.css" /><link rel="stylesheet" href="css/mycss.css" /><link rel="stylesheet" href="css/bootstrap-datetimepicker.min.css" /><script src="js/bootstrap.js"></script><script src="js/jquery.min.js"></script><script src="js/bootstrap.min.js"></script><script src="js/bootstrap-select.min.js"></script><script src="js/jquery.backstretch.min.js"></script><script src="js/jquery.bootstrap-touchspin.min.js"></script><script src="js/jquery.contextmenu.min.js"></script><script src="Scripts/bootstrap-datetimepicker.min.js"></script>這是我的控制:<div class="row" id="div9" runat="server"> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6" style="margin-top: 5px"> <asp:Label ID="Label14" runat="server" Text="Start Date" CssClass="form-control" Font-Bold="true" ForeColor="Black" Font-Size="14px"></asp:Label> </div> <div class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <asp:TextBox ID="txt_start_date" runat="server" CssClass="form-control" TextMode="SingleLine" Width="100%" ForeColor="Black" Font-Bold="True"></asp:TextBox> </div></div>這是我的腳本:<script type="text/javascript"> $(function () { $('#txt_start_date').datetimepicker({ format: 'YYYY-MM-DD', useCurrent: true }); }); });</script>
2 回答

繁花不似錦
TA貢獻(xiàn)1851條經(jīng)驗(yàn) 獲得超4個(gè)贊
Boostrap 4 不支持日期時(shí)間選擇器。更改文件 bootstrap-datetimepicker.min.js
'collapse in'
expanded = $parent.find('.in'),
closed = $parent.find('.collapse:not(.in)'),
expanded.removeClass('in');
closed.addClass('in');
到
'collapse show'
expanded = $parent.find('.show'),
closed = $parent.find('.collapse:not(.show)'),
expanded.removeClass('show');
closed.addClass('show');

侃侃無(wú)極
TA貢獻(xiàn)2051條經(jīng)驗(yàn) 獲得超10個(gè)贊
試試這個(gè)代碼,不需要使用 Jquery。使用輸入類(lèi)型日期而不是文本。
<input type="date" class="form-control"/>
添加回答
舉報(bào)
0/150
提交
取消