日期:2014-05-16  浏览次数:20385 次

怎样让jQueryUI 的日历控件显示中文日历?
如题,默认显示的jQueryUI日历控件显示的是英文,怎样修改让其显示中文?

------解决方案--------------------
需要加载中文的js,类似如下写法:
<script type="text/javascript" src="jquery-ui-1.8.16/ui/i18n/jquery.ui.datepicker-zh-CN.js"></script>
------解决方案--------------------
$("#datepicker").datepicker({
dateFormat: 'yy-mm-dd', inline: true,
monthNames: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
dayNamesMin: ["日", "一", "二", "三", "四", "五", "六"],
onSelect: function (dateText, inst) {
var theDate = new Date(Date.parse($(this).datepicker('getDate')));
var dateFormatted = $.datepicker.formatDate('yy-mm-dd', theDate);
}

我上面的使用的版本是1.87,你看看你引用的JQuery版本代码,里面封装了日历控件的。
------解决方案--------------------
jquery.ui.datepicker-zh-CN.js