1.html
<ul class="dealFlowSelectedBox_timeBox">
<li>
<span>开始时间</span>
<input type="text" id="starDate" name="starDate" value="" placeholder="请选择开始日期" readonly="readonly" />
<img src="../img/index/index_xyjt.png" />
</li>
<li>
<span>结束时间</span>
<input type="text" id="endDate" name="endDate" value="" placeholder="请选择结束日期" readonly="readonly" />
<img src="../img/index/index_xyjt.png" />
</li>
</ul>
2.JS
<script type="text/javascript">
$('#starDate').mobiscroll().date({
theme : 'android-ics light', //皮肤样式
display : 'modal', //显示方式
mode : 'scroller', //日期选择模式
endYear: 5000, //可根据当前年份设置
lang : 'zh',
dateFormat : "yyyy-mm-dd",
showNow : true,
nowText : "今天",
onSelect : function(textVale, inst) { //选中时触发事件
var array = textVale.split('-');
var ay = array[2].split(' ');
$('#endDate').mobiscroll().date({
theme : 'android-ics light', //皮肤样式
display : 'modal', //显示方式
mode : 'scroller', //日期选择模式
endYear: 5000, //可根据当前年份设置
lang : 'zh',
dateFormat : "yyyy-mm-dd",
minDate : new Date(array[0], array[1] - 1, ay[0]),
showNow : true,
nowText : "今天",
});
}
});
</script>
3.JS文件
<!-- 时间插件 -->
<script src="../js/public/mobiscrollDate/mobiscroll_002.js" type="text/javascript"></script>
<script src="../js/public/mobiscrollDate/mobiscroll_004.js" type="text/javascript"></script>
<link href="../css/public/mobiscrollDate/mobiscroll_002.css" rel="stylesheet" type="text/css">
<link href="../css/public/mobiscrollDate/mobiscroll.css" rel="stylesheet" type="text/css">
<script src="../js/public/mobiscrollDate/mobiscroll.js" type="text/javascript"></script>
<script src="../js/public/mobiscrollDate/mobiscroll_003.js" type="text/javascript"></script>
<script src="../js/public/mobiscrollDate/mobiscroll_005.js" type="text/javascript"></script>
<link href="../css/public/mobiscrollDate/mobiscroll_003.css" rel="stylesheet" type="text/css">