ASP.NET Calendar Tutorial - Custom DateRange

When date in first calendar is selected, second takes the same date.

Date 1:  


Date 2:  


This feature can be implemented in multiple calendars using the followign JS code:
Javascript:

<script type="text/javascript">
        function onDateChange(sender, selectedDate) {
		var formattedDate = sender.formatDate(selectedDate, "M/d/yyyy");
		var date = formattedDate.split('/');
		        
		var year = date[2];
		var month = date[0];
		var day = date[1];
		
		EndCalendar.setDate(new Date(year, month-1, day), new Date(year, month-1, day));
		
        }
        
</script>

"Thanks much. The trees seem to be working exactly as we want and we do appreciate the timely resolution. As our project moves further along the design process, we find ourselves utilizing Obout controls more and more and it's comforting to know that your support system is so responsive."

Kevin Holder
Tennessee Department of Human Services

Random testimonial   All testimonials