jQuery UI 日期選取器(Datepicker)

來源:互聯網
上載者:User

標籤:number   head   sdn   reg   lang   set   code   jquery ui   select   

 

設定JqueryUI DatePicker預設語言為中文

 

<!doctype html>
<html lang="en">

<head>
<meta charset="utf-8">
<title>jQuery UI 日期選取器(Datepicker) - 預設功能</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
<script src="//code.jquery.com/jquery-1.9.1.js"></script>
<script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script>
$(function() {
$("#datepicker").datepicker({
showOtherMonths: true,
selectOtherMonths: true,
showButtonPanel: true,
changeMonth: true,
changeYear: true,
numberOfMonths: 1
});
$("#datepicker").datepicker("option", "showAnim", "slideDown");
$("#datepicker").datepicker("option", "dateFormat", "mm/dd/yy");
$.datepicker.regional["zh-CN"] = {
closeText: "關閉",
prevText: "&#x3c;上月",
nextText: "下月&#x3e;",
currentText: "今天",
monthNames: ["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
monthNamesShort:["一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月"],
dayNames: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
dayNamesShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
dayNamesMin: ["日", "一", "二", "三", "四", "五", "六"],
weekHeader: "周",
dateFormat: "yy-mm-dd",
firstDay: 1,
isRTL: !1,
showMonthAfterYear: !0,
yearSuffix: "年"
}

$.datepicker.setDefaults($.datepicker.regional["zh-CN"]);
});
</script>
</head>

<body>

<p>日期:<input type="text" id="datepicker"></p>

</body>

</html>

jQuery UI 日期選取器(Datepicker)

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.