gpt4 book ai didi

jquery - 为什么我的 jquery UI 日期选择器没有默认为英语

转载 作者:行者123 更新时间:2023-12-03 22:01:12 24 4
gpt4 key购买 nike

我基本上复制了代码from here但是当我测试我的网站时,我看到了这个:

alt text http://img148.imageshack.us/img148/8167/datepicker.png

知道为什么我没有收到英文日历

最佳答案

From the jQuery UI docs ,它基于您计算机的区域设置,正如 c0mrade 在评论中所说,但您可以覆盖:

本地化

Datepicker provides support for localizing its content to cater for different languages and date formats. Each localization is contained within its own file with the language code appended to the name, e.g. jquery.ui.datepicker-fr.js for French. These files are loaded after the main datepicker code. They add their settings to the set of available localizations and automatically apply them as defaults for all instances.

The $.datepicker.regional attribute holds an array of localizations, indexed by language code, with '' referring to the default (English). Each entry is an object with the following attributes: closeText, prevText, nextText, currentText, monthNames, monthNamesShort, dayNames, dayNamesShort, dayNamesMin, weekHeader, dateFormat, firstDay, isRTL, showMonthAfterYear, and yearSuffix.

You can restore the default localizations with:

$.datepicker.setDefaults($.datepicker.regional['']);

And can then override an individual datepicker for a specific locale:

$(selector).datepicker($.datepicker.regional['fr']);

关于jquery - 为什么我的 jquery UI 日期选择器没有默认为英语,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2244016/

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