簡體   English   中英

單擊設置按鈕時jQuery Mobile Datebox時間重置

[英]Jquery mobile datebox time resetting when click set button

我正在嘗試使用jquery移動日期框(來自Jtsage )來選擇時間和日期。 但是每次重置時間時,單擊“設置”按鈕,我都無法獲取時間。 這是我的代碼:

 $.extend($.jtsage.datebox.prototype.options, { useInline: true, hideInput: true, overrideSlideFieldOrder: ['y','m','d','h','i'], dateFormat: "%Y-%m-%d %H:%i", useHeader:false }); 
 <script src="https://cdn.jsdelivr.net/npm/jtsage-datebox-jqm@4.3.1/jtsage-datebox.min.js"></script> <link href="https://cdn.jsdelivr.net/npm/jtsage-datebox-jqm@4.3.1/jtsage-datebox.min.css" rel="stylesheet"/> <script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script> <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> <link href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" rel="stylesheet"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <div data-role="page" id="attendanceMarkPage"> <div data-role="header" data-theme="a"> <a href="#mainPage" class="ui-btn ui-shadow ui-icon-arrow-l ui-btn-icon-notext ui-btn-inline"></a> <h1>Salary</h1> </div><!-- /header --> <div role="main" class="ui-content"> <form class="ui-filterable"> <div class="ui-field-contain"> <label for="attendanceMarkTime">Time:-</label> <input name="themee" id="attendanceMarkTime" data-role="datebox" data-datebox-mode="slidebox" data-options='{}' readonly="readonly" type="text"> <input type="hidden" name="attendanceTime" id="attendanceMarkEmployee"/> </div> <div class="ui-field-contain"> <input type="submit" value="Update"/> </div> </form> </div><!-- /content --> </div><!-- /page --> 

是否有任何功能可以覆蓋現有功能,或者如何獲取日期和時間兩者?

很抱歉打擾您。經過長時間的研究,我找到了答案。 我已經添加了

overrideDateFormat: "%Y-%m-%d %k:%M"

參數。 現在工作了。 感謝您的觀看。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM