jquery ui datepicker详解
来源:互联网 发布:税友集团数据挖掘 知乎 编辑:程序博客网 时间:2024/06/05 04:14
$("#pickerStartDate,#pickerEndDate").datepicker({ dateFormat : 'yy/mm/dd', //日期格式 showAnim : 'scale', //显示效果 slide | scale | fadeIn showButtonPanel : true, //显示按钮面板 currentText : '今天', closeText : '完成', dayNamesMin : ['日', '一', '二', '三', '四', '五', '六'], monthNames : ['1月','2月','3月','4月','5月','6月','7月','8月','9月','10月','11月','12月'], beforeShow : function(picker){ // 开始日期小于结束日期 return { minDate : (picker.id == "pickerEndDate" ? $("#pickerStartDate").datepicker("getDate"): null), maxDate : (picker.id == "pickerStartDate" ? $("#pickerEndDate").datepicker("getDate") : null) } } })
参数说明如上
从 <input type="text" id="pickerStartDate"/>到 <input type="text" id="pickerEndDate"/>