1.开始日期跟结束日期只能输入年与月,最大不超过当前月份,并且结束日期必须大于结束日期
<input id="s1" class="Wdate" value="@DateTime.Now.AddDays(-0).ToString("yyyy-MM")" />
<input id="e1" class="Wdate" value="@DateTime.Now.AddDays(-0).ToString("yyyy-MM")" />
$("#s1").on("focus", function () {
var theme = $("link[data-theme]").eq(0).attr("data-theme");
WdatePicker({ dateFmt: 'yyyy-MM', readOnly: true, skin: theme, maxDate: '#F{$dp.$D(\'e1\')}' });
});
$("#e1").on("focus", function () {
var theme = $("link[data-theme]").eq(0).attr("data-theme");
WdatePicker({ dateFmt: 'yyyy-MM', readOnly: true, skin: theme, minDate: '#F{$dp.$D(\'s1\')}', maxDate: '%y-%M' });
});
2.开始日期跟结束日期输入年与月与日,最大不超过当前日期,并且结束日期必须大于结束日期
<input id="s1" class="Wdate" value="@DateTime.Now.AddDays(-0).ToString("yyyy-MM-dd")" />
<input id="e1" class="Wdate" value="@DateTime.Now.AddDays(-0).ToString("yyyy-MM-dd")" />
$("#s1").on("focus", function () {
var theme = $("link[data-theme]").eq(0).attr("data-theme");
WdatePicker({ dateFmt: 'yyyy-MM-dd', readOnly: true, skin: theme, maxDate: '#F{$dp.$D(\'e1\')}' });
});
$("#e1").on("focus", function () {
var theme = $("link[data-theme]").eq(0).attr("data-theme");
WdatePicker({ dateFmt: 'yyyy-MM-dd', readOnly: true, skin: theme, minDate: '#F{$dp.$D(\'s1\')}', maxDate: '%y-%M-%d' });
});