JQuery 日期选择器语言 [英] JQuery datepicker language

查看:37
本文介绍了JQuery 日期选择器语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 jqueryui.com 的 jQuery 日期选择器,但在将日历更改为瑞典语时遇到问题,我有以下代码:

I'm using the jQuery datepicker from jqueryui.com and I have a problem changing the calendar to Swedish, I have this code:

    <script type="text/javascript">
    $(function() {
        $.datepicker.setDefaults($.datepicker.regional['sv']);
        $("#StartDate").datepicker();
        $('#StartDate').datepicker('option', 'dateFormat', 'yy-mm-dd');
    }); 
</script>

它仍然显示为英文日历.

Still it shows as an English calendar.

可能缺少什么?

推荐答案

也许你没有语言文件:

语言文件在这里:https://github.com/jquery/jquery-ui/tree/master/ui/i18n

应该创建一个新的本地化在一个名为的单独 JavaScript 文件中ui.datepicker-.js.在一个document.ready 事件它应该添加一个新进入$.datepicker.regional 数组,索引由语言代码,与以下属性:

A new localization should be created in a separate JavaScript file named ui.datepicker-.js. Within a document.ready event it should add a new entry into the $.datepicker.regional array, indexed by the language code, with the following attributes:

http://api.jqueryui.com/datepicker/

这篇关于JQuery 日期选择器语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆