简体   繁体   English

日期框格式为mm / dd / YYYY如何?

[英]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>

Working Fiddle not correct format 工作小提琴格式不正确

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.

相关问题 如何将 JavaScript 日期格式化为 mm/dd/yyyy? - How to format JavaScript date to mm/dd/yyyy? 如何使用正则表达式将字符串格式化为mm / dd / yyyy - How to format string to mm/dd/yyyy with regex 如何将 JavaScript 文件中的“yyyy-MM-dd”格式转换为 HTML 文件中的“dd/MM/yyyy”和“MM/dd/yyyy”格式? - How to convert “yyyy-MM-dd” format present in JavaScript file to “dd/MM/yyyy” and “MM/dd/yyyy” format in HTML file? 如何验证 MM/dd/yyyy hh:mm 格式的日期时间? - How to validate the DateTime of MM/dd/yyyy hh:mm format? 如何将日期格式化为 (dd/mm/yyyy hh:mm:ss) - How to format the date to (dd/mm/yyyy hh:mm:ss) Safari浏览器中的日期[dd / mm / yyyy]无效? 如何使用jQuery以dd / mm / yyyy格式显示 - Invalid date [dd/mm/yyyy] in safari? How to display in dd/mm/yyyy format using jquery 如何允许正则表达式适用于mm / dd / yyyy和yyyy-mm-dd格式 - How to allow regex to work for mm/dd/yyyy and yyyy-mm-dd format 如何用点将日期19990813(YYYY-MM-DD)格式化为13.08.1999(DD-MM-YYYY)? - How to format the date 19990813 (YYYY-MM-DD) to 13.08.1999 (DD-MM-YYYY) with the the dots? 如何将NgbDatePicker格式从YYYY-MM-DD更改为MM-DD-YYYY角4? - how to change NgbDatePicker format from YYYY-MM-DD to MM-DD-YYYY angular 4? 如何将日期格式从YYYY-DD-MM转换为DD-MM-YYYY - How to convert date format from YYYY-DD-MM to DD-MM-YYYY
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM