<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript" type="text/ecmascript" src="../include/jquery-1.7.1.min.js"></script>
<script language="javascript" type="text/ecmascript" src="../include/jquery-ui-1.8.18.custom.min.js"></script>
<!--引入css样式文件-->
<link rel="stylesheet" href="css/ui-lightness/jquery-ui-1.8.18.custom.css">
<style>
#startTime,#endtime{
/*background-color:#03C;*/
}
</style>
<script type="text/javascript">
$(document).ready(function(){
//设置日历显示的采用的地区 是中国
$.datepicker.setDefaults($.datepicker.regional["zh-CN"]);
$("#startTime,#endTime").datepicker({
//altField:"#actualDate",
//altFormat:"yy-mm-dd",
autoSize:false, //自动调整大小的操作 改变的输入框的大小
changeMonth:false,//如果为true弹出一个下拉菜单
changeYear:true, //前边有默认10年 当前年份 后边有默认10年组成的下拉菜单
dateFormat:"yy-mm-dd", //日期的格式 呈现在文本框中
defaultDate:+1, //缺省的日期 + -相当于当前的日期计算
showWeek:true, //显示当前年的周数
fistDay:1, //当前年份开始的第一天
showOn:"button", //button既可以触发按钮 又可以触发文本框弹出----日历 如果是button 只能触发button事件
buttonImage:"images/calendar.gif", //设置按钮的图片
buttonImageOnly:true, //设置这按钮只显示图片效果 不要有button的样式
showAnim:"toggle", //弹出日历的效果
prevText:"上一月",
nextText:"下一月",
yearRange:"c-5:c+5", //年份的前后取值范围
numberOfMonths:3, //连续弹出3个月的日历
showButtonPanel:true,
closeText:"guan",
onSelect:function(text,inst){
alert(textDate);
}
});
});
</script>
</head>
<body>
<div>演示日历的效果</div>
活动开始日期:<input type="text" id="startTime">
活动的结束日期:<input type="text" id="endTime">
<!--div id="datepicker"></div-->
</body>
</html>