使用两个日期选择器jQuery的日期选择器最大日期分钟日期控件 [英] jquery datepicker max date min date control using two date picker
本文介绍了使用两个日期选择器jQuery的日期选择器最大日期分钟日期控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有什么:我在jQuery的2日期选择器日历控制,其中1号,只能选择日期当前的日期和previous日期,但不包括未来的日期,我已经写了code的正常工作
what I have : I have two datepicker calender control in jquery where 1st can only choose date current date and previous date but not future date for that I have written the code which works fine
<script type="text/javascript">
$(function () {
$("#from").datepicker({ maxDate: 0 });
});
</script>
现在我必须用另一种文本与日期选择只能选择第一个文本框和当前日期选定日期之间的日期。
Now I have to use another textbox with datepicker which can only select dates between the date selected in 1st textbox and current date.
现在具有这些条件的,我应该写什么code为我的第二个日期选择器。
Now having these conditions what code should I write for my second datepicker.
我的项目是在ASP.NET的使用C#。任何帮助将是AP preciated
my project is in Asp .net using c#. Any help would be appreciated
推荐答案
请尝试以下:
<script type = "text/javascript">
$(function () {
$("#from").datepicker({
onSelect: function (date) {
$("#to").datepicker("option","minDate", date);
$("#to").datepicker("option","maxDate", new Date());
},
maxDate: 0
});
});
</script>
这篇关于使用两个日期选择器jQuery的日期选择器最大日期分钟日期控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文