gpt4 book ai didi

javascript - jquery datepicker 德语

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:15:53 27 4
gpt4 key购买 nike

我现在已经实现了 Jquery-UI,它运行良好,但我希望全部使用德语,例如日期选择器。

我已经尝试更改 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>

我怎样才能把这些东西变成德语?

最佳答案

只包含正确的 language.js

-> https://github.com/jquery/jquery-ui/tree/master/ui/i18n

对于德语:-> https://raw.githubusercontent.com/jquery/jquery-ui/master/ui/i18n/datepicker-de.js

然后调用这种语言:

$( selector ).datepicker( $.datepicker.regional[ "de" ] )

关于javascript - jquery datepicker 德语,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31278603/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com