0
@Gnanavel Sekar , Thanks for your reply. I will also try this one.
0
Just set the minimum value for second calender once the date picked from first calender , for this you may use client side jquery to overcome this.
example in click event
var arr = selectedDate.split("/");
var date = new Date(arr[2]+"-"+arr[1]+"-"+arr[0]);
var d = date.getDate();
var m = date.getMonth();
var y = date.getFullYear();
var minDate = new Date(y, m, d + 1);
$("#EndDate").datepicker('setDate', minDate);
Refer below links
http://stackoverflow.com/questions/27721133/jquery-datepickers-setting-end-date-from-a-start-date
http://stackoverflow.com/questions/24894048/jquery-datepicker-how-to-set-start-and-end-date
http://stackoverflow.com/questions/17016598/jquery-ui-picking-a-start-and-end-date-within-range-based-on-start-date
http://www.aspsnippets.com/Articles/jQuery-DatePicker-Start-Date-should-be-less-than-End-date-validation.aspx
0
@Nitin Sontakke
Thank you for pointing my mistake. I got it now. The problem is the ">", I changed it to "<" and now it worked!.
- protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
- {
- DateTime date = Convert.ToDateTime(TextBox1.Text);
-
- if (e.Day.Date < date)
- {
- e.Cell.Enabled = false;
- e.Day.IsSelectable = false;
- }
- }
0
@Nitin Sontakke
Yes I have seen it but it's a different scenario.
0
Have you had a look at this?
http://stackoverflow.com/questions/10227417/setting-minimum-and-maximum-date-on-calendar