您的位置:首页 > Web前端 > JQuery

jQuery UI设计酒店中文日历

2016-03-05 12:08 525 查看
首先需要引入jquery ui的js和css

接下来直接看代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="js/jquery.js" ></script>
<script type="text/javascript" src="js/jquery-ui.js" ></script>
<link rel="stylesheet" href="css/jquery-ui.css" />
<style>
.ui-datepicker {
width: 12em;
}
</style>
<script>
$(function() {
$("#datepicker").datepicker({
/* 区域化周名为中文 */
dayNamesMin : ["日", "一", "二", "三", "四", "五", "六"],
/* 每周从周一开始 */
firstDay : 1,
/* 区域化月名为中文习惯 */
monthNames : ["1月", "2月", "3月", "4月", "5月", "6月",
"7月", "8月", "9月", "10月", "11月", "12月"],
/* 月份显示在年后面 */
showMonthAfterYear : true,
/* 年份后缀字符 */
yearSuffix : "年", showOtherMonths:true,
/* 格式化中文日期
(因为月份中已经包含“月”字,所以这里省略) */
dateFormat : "yy-mm-dd"
});

});
</script>
</head>
<body>

<input type="text" id="datepicker" placeholder="请选择入住日期" />

</body>
</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: