更改jquery-ui datepicker的语言 [英] changing language of jquery-ui datepicker

查看:73
本文介绍了更改jquery-ui datepicker的语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我是jquery的新手,因为我的应用程序是法语的,所以我想更改datepicker的语言以匹配它,因为不是每个使用该应用程序的人都知道英语

hello im new to jquery and since my application is in french I want to change the language of datepicker to match it since not everyone who will use the app knows english

这是我的日期选择器,其中jquery-ui为简化版本:

Here is my datepicker with jquery-ui as a simplified version:

<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>
$(document).ready(function () {
   $.datepicker.setDefaults($.datepicker.regional['fr']);
   $("#datepicker").datepicker({
      format: 'DD-MM-YYYY'
   });
});
</script>
<input type="text" id="datepicker" />

这是jsfiddle的链接: https://jsfiddle.net/r1cpw2sn/ datepicker.setdefaults似乎不起作用,我没有找到另一个选项appart,它把所有月份的名称都放在一个数组中,这对我来说似乎不是一个好主意

Here is the link to the jsfiddle : https://jsfiddle.net/r1cpw2sn/ datepicker.setdefaults dosen't seem to work and I didn't find another option appart from putting all month name in an array which dosen't seem like a good idea to me

任何有关如何使这项工作的技巧都将不胜感激

Any tips on how to make this work would be really appreciated

推荐答案

您需要按照,并在此链接中引用堆栈溢出的答案.

and also refer stack overflows answer in this link.

这篇关于更改jquery-ui datepicker的语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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