我现在已经实现了
Jquery-UI并且它工作正常,但我希望全部使用德语,例如datepicker.
我已经尝试过更改jquery-ui.js中的字符串:
this._dayOverClass = "ui-datepicker-days-cell-over"; // The name of the day hover marker class
this.regional = []; // Available regional settings, indexed by language code
this.regional[""] = { // Default regional settings
closeText: "Done", // Display text for close link
prevText: "Prev", // Display text for previous month link
nextText: "Next", // Display text for next month link
currentText: "Today", // Display text for current month link
monthNames: ["Januar","Februar","März","April","Mai","Juni",
"Juli","August","September","Oktober","November","Dezember"], // Names of months for drop-down and formatting
monthNamesShort: ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"], // For formatting
dayNames: ["Sonntag", "Montag", "Dienstag", "Mittwoch", "Dienstag", "Freitag", "Samstag"], // For formatting
dayNamesShort: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], // For formatting
dayNamesMin: ["So","Mo","Di","Mi","Do","Fr","Sa"], // Column headings for days starting at Sunday
weekHeader: "KW", // Column header for week of the year
dateFormat: "dd.mm.yy", // See format options on parseDate
firstDay: 0, // The first day of the week, Sun = 0, Mon = 1, ...
isRTL: false, // True if right-to-left language, false if left-to-right
showMonthAfterYear: false, // True if the year select precedes month, false for month then year
yearSuffix: "" // Additional text to append to the year in the month headers
};
这没用,所以我尝试在index.php中插入一个脚本:
<script>$.datepicker.setDefaults($.datepicker.regional['de']);</script>
我怎样才能将这些东西送到德国?
最佳答案 另一种选择,如果你想要包括一切
$(function() {
$.datepicker.regional['de'] = {
closeText: 'Done',
prevText: 'Prev',
nextText: 'Next',
currentText: 'heute',
monthNames: ['Januar','Februar','März','April','Mai','Juni',
'Juli','August','September','Oktober','November','Dezember'],
monthNamesShort: ['Jan','Feb','Mär','Apr','Mai','Jun',
'Jul','Aug','Sep','Okt','Nov','Dez'],
dayNames: ['Sonntag','Montag','Dienstag','Mittwoch','Donnerstag','Freitag','Samstag'],
dayNamesShort: ['So','Mo','Di','Mi','Do','Fr','Sa'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
weekHeader: 'KW',
dateFormat: 'dd.mm.yy',
firstDay: 0,
isRTL: false,
showMonthAfterYear: false,
yearSuffix: ''};
$("#StartDate").datepicker( $.datepicker.regional[ "de" ] );
$('#StartDate').datepicker('option', 'dateFormat', 'yy-mm-dd');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"></link>
<input type='text' id='StartDate' />