JQuery Mobile UI DatePicker Change Date Format
JQuery Mobile UI DatePicker Change Date Format
我正在尝试更改 JQM UI 日期选择器中的日期格式。
它有一个输入,在您更改日期时显示日期。
我需要它以 dd/mm/yyyy 格式显示。
谁能帮忙?
更新:
我正在尝试这个,但没有任何变化:
<script>
//reset type=date inputs to text
$( document ).bind( "mobileinit", function(){
$.mobile.page.prototype.options.degradeInputs.date = true;
});
</script>
<script language="javascript">
$(document).ready(function() {
$.datepicker.formatDate('dd/mm/yyyy'); //ADDED HERE
$("input[type='submit']").click(function(e) {
e.preventDefault();
});
});
</script>
试试这个$.datepicker.formatDate('dd/mm/yyyy');
更多参考在这里
更改"jquery.ui.datepicker.mobile.js"文件
添加日期格式:日期格式:"日/月/年"代码如下所示
//bind to pagecreate to automatically enhance date inputs
$( ".ui-page" ).live( "pagecreate", function(){
$( "input[type='date'], input[data-type='date']" ).each(function(){
$(this).after($("<div />").datepicker({ altField: "#" + $(this).attr("id"), showOtherMonths: true, dateFormat: "dd/mm/yy" }));
});
});
相关文章:
- 在事件上打开Materialize Date Picker
- 在经过DATE验证的列中创建null值
- 如何将Date字段设置为等于另一个Date+Int值,该值表示月份值
- 为什么要做新的.Date()与new相差1小时.日期().到ISOString()
- 返回值+new Date()与Date.now()是否不同
- Javascript Date.toString() formatting?
- Javascript返回错误的Date值(NodeJS)
- 使用.format在一些HTML代码中插入文本,会出现错误(Python)
- date对象未在javascript中返回正确的日期值
- 当点击今天按钮时,Bootstrap Date Time Picker未选择当前时间
- Format for Excel VBA addWatermarkFromText
- 新Date()javascript的日期字符串
- jQuery format date min & max date jQuery UI
- format-undefined不是Date对象的函数
- MomentJS Date.now() format
- date对象在使用D3.time.format进行解析时返回不同的日期
- JQuery Mobile UI DatePicker Change Date Format
- javascript , jquery Object [object Date] 没有方法“format”
- format string from Date.getTime()
- Ext.Date.format doesn't work