jQuery UI设计酒店中文日历

来源:互联网 发布:什么是数据新闻 编辑:程序博客网 时间:2024/05/01 13:27

首先需要引入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>


1 0
原创粉丝点击