[英]datebox format as mm/dd/YYYY How?
How do you change date format in date box? 如何更改日期框中的日期格式? there are lots of different examples, none seem to work for me.
有很多不同的例子,似乎没有一个适合我。 Here is working JSFiddle of popup but I need date format like 11/07/2013.
这是弹出式窗口的JSFiddle,但我需要类似11/07/2013的日期格式。
Tried: "dateFormat":"%m/%d/%Y" and "overrideDateFormat":"%m/%d/%Y" 尝试过:“ dateFormat”:“%m /%d /%Y”和“ overrideDateFormat”:“%m /%d /%Y”
<div data-role="page" id="page1">
<div data-role="header">
<h1>My page</h1>
<a data-role="button" id="myplus" class="ui-btn-right" >+</a>
<input name="mydate" id="mydate" type="date" data-role="datebox" data-options='{"mode": "calbox", "hideInput": "true", "centerHoriz": "true", "closeCallback":"onCLoseMyDate();"}' />
</div>
<div data-role="content">
</div>
Found at http://dev.jtsage.com/jQM-DateBox2/demos/api/events.html , under "Public Functions" 在http://dev.jtsage.com/jQM-DateBox2/demos/api/events.html的 “公共功能”下找到
$('element').datebox('callFormat', <format> <date>)
As applied to your [updated] fiddle: 应用于您的[更新]小提琴:
var dateObject = $('#mydate').datebox('getTheDate'),
theDate = $('#mydate').datebox('callFormat', '%m/%d/%Y', dateObject);
alert(theDate);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.