gpt4 book ai didi

jquery-ui datepicker 多种语言

转载 作者:行者123 更新时间:2023-12-01 04:46:33 26 4
gpt4 key购买 nike

我正在尝试在页面上创建支持多种语言的日期选择器,并且我单独包含了语言文件,但它只显示默认语言

$(".datepicker, .datepicker-ru").datepicker({
changeMonth: true,
changeYear: true
});

$(".datepicker").datepicker($.datepicker.regional['en']);
$(".datepicker-ru").datepicker($.datepicker.regional['ru']);

最佳答案

查看此链接:http://jqueryui.com/datepicker/#localization

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery UI Datepicker - Localize calendar</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.10.2.js"></script>
<script src="//code.jquery.com/ui/1.11.3/jquery-ui.js"></script>
<script src="datepicker-ar.js"></script>
<script src="datepicker-fr.js"></script>
<script src="datepicker-he.js"></script>
<script src="datepicker-zh-TW.js"></script>
<link rel="stylesheet" href="/resources/demos/style.css">
<script>
$(function() {
$( "#datepicker" ).datepicker( $.datepicker.regional[ "fr" ] );
$( "#locale" ).change(function() {
$( "#datepicker" ).datepicker( "option",
$.datepicker.regional[ $( this ).val() ] );
});
});
</script>
</head>
<body>

<p>Date: <input type="text" id="datepicker">&nbsp;
<select id="locale">
<option value="ar">Arabic (&#8235;(&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1577;</option>
<option value="zh-TW">Chinese Traditional (&#32321;&#39636;&#20013;&#25991;)</option>
<option value="">English</option>
<option value="fr" selected="selected">French (Fran&ccedil;ais)</option>
<option value="he">Hebrew (&#8235;(&#1506;&#1489;&#1512;&#1497;&#1514;</option>
</select></p>


</body>
</html>

关于jquery-ui datepicker 多种语言,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28632502/

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