【发布时间】:2014-06-16 10:53:22
【问题描述】:
我正在尝试本地化 jquery datepicker,但由于我不是 jquery 专家,所以我收到一个错误,我不知道如何修复它。
错误
TypeError: 'undefined' is not an object (evaluating '$.ui.datepicker.regional')
这里是日期选择器的代码
calendar.js
$(function() {
$( ".from" ).datepicker({
defaultDate: "+1w",
dateFormat: "dd/mm/yy",
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
$( ".to" ).datepicker( "option", "minDate", selectedDate );
}
});
$( ".to" ).datepicker({
defaultDate: "+1w",
dateFormat: "dd/mm/yy",
changeMonth: true,
numberOfMonths: 1,
onClose: function( selectedDate ) {
$( ".from" ).datepicker( "option", "maxDate", selectedDate );
}
});
});
和本地化
<script src="//jquery-ui.googlecode.com/svn-history/r3875/branches/labs/datepicker2/ui/i18n/jquery.ui.datepicker-it.js" ></script>
它们都在以下代码之后
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
【问题讨论】:
标签: jquery jquery-ui datepicker