jeesite4日期控件限制选择日期范围

效果图:

我的list页面代码:

<div class="form-group">
	<label class="control-label">${text('xx初筛时间(段)')}:</label>
	    <div class="control-inline">
			<#form:input path="screeningBeginDate" id="screeningBeginDate" readonly="true" maxlength="20" class="form-control Wdate-datetime"	dataFormat="datetime" />						
		   &nbsp;--&nbsp;
			<#form:input path="screeningEndDate" id="screeningEndDate" readonly="true" maxlength="20" class="form-control Wdate-datetime" dataFormat="datetime" />					
		</div>
</div>

 list页面的js代码:

$("#screeningBeginDate").click(function () {
    WdatePicker({
    	name:'zh-cn', 
    	charset:'UTF-8',
        dateFmt: 'yyyy-MM-dd HH:mm',
        maxDate: '#F{$dp.$D(\'screeningEndDate\')||\'%y-%M-%d\'}',
        readOnly: true
    })
})
$("#screeningEndDate").click(function () {
    WdatePicker({
    	name:'zh-cn', 
    	charset:'UTF-8',
        dateFmt: 'yyyy-MM-dd HH:mm',
        minDate: '#F{$dp.$D(\'screeningBeginDate\')}',
        maxDate: '%y-%M-%d',
        readOnly: true
    })
})

name:'zh-cn',  charset:'UTF-8',是设置中文的,参考:

发现设置了lang属性还是默认英文 后来设置:

参考的博客:https://blog.csdn.net/zengxin2008/article/details/7248964#m32 

猜你喜欢

转载自blog.csdn.net/qq_37725560/article/details/90711393