jQuery UI Datepicker 日期显示问题
core_pnum=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,这串代码显示出来是03/14/2014我换成/^(\d+)-...
core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
这串代码显示出来是03/14/2014
我换成/^(\d+)-(\d{1,2})-(\d{1,2})$/ 想显示成2014-03-14
没法实现呢?而且还有能把英语的月份改成中文吗?
The format for parsed and displayed dates. For a full list of the possible formats see the formatDate function.
Code examples:
Initialize the datepicker with the dateFormat option specified:
1
$( ".selector" ).datepicker({ dateFormat: "yy-mm-dd" });
// getter
var dateFormat = $( ".selector" ).datepicker( "option", "dateFormat" );
// setter
$( ".selector" ).datepicker( "option", "dateFormat", "yy-mm-dd" );
官网上看到的。。可是不知道怎么加 展开
这串代码显示出来是03/14/2014
我换成/^(\d+)-(\d{1,2})-(\d{1,2})$/ 想显示成2014-03-14
没法实现呢?而且还有能把英语的月份改成中文吗?
The format for parsed and displayed dates. For a full list of the possible formats see the formatDate function.
Code examples:
Initialize the datepicker with the dateFormat option specified:
1
$( ".selector" ).datepicker({ dateFormat: "yy-mm-dd" });
// getter
var dateFormat = $( ".selector" ).datepicker( "option", "dateFormat" );
// setter
$( ".selector" ).datepicker( "option", "dateFormat", "yy-mm-dd" );
官网上看到的。。可是不知道怎么加 展开
1个回答
展开全部
<script>
$(function () {
$(".datepicker").datepicker(
{
gotoCurrent: true,
yearRange: 'c-10:c',
prevText: '上个月',
nextText: '下个月',
showMonthAfterYear: true,
dateFormat: 'yy/mm/dd',
changeMonth: true,
changeYear: true,
dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
currentText: "today",
monthNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
showWeek:true,
calculateWeek: this.iso8601Week
});
})
</script>
$(function () {
$(".datepicker").datepicker(
{
gotoCurrent: true,
yearRange: 'c-10:c',
prevText: '上个月',
nextText: '下个月',
showMonthAfterYear: true,
dateFormat: 'yy/mm/dd',
changeMonth: true,
changeYear: true,
dayNamesMin: ['日', '一', '二', '三', '四', '五', '六'],
currentText: "today",
monthNamesShort: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
showWeek:true,
calculateWeek: this.iso8601Week
});
})
</script>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询