javascriptjqueryhtmljquery-mobiledatebox

Jquery mobile datebox time resetting when click set button


I am trying to use jquery mobile datebox (from Jtsage) for selecting time and date. But every time resetting time when click set button and i can't get the time. here is my codes:-

$.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 -->

Is there any function to override exist function or how to get the both of date and time?


Solution

  • Sorry for disturb you.I have found the answer after long research. I have added

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

    to parameters. Now it working. Thank you for view this.