View Single Post
Old 02-19-2013, 05:41 PM   PM User | #3
nani_nisha06
Regular Coder

 
Join Date: Oct 2012
Location: mother land --india
Posts: 159
Thanks: 37
Thanked 2 Times in 2 Posts
nani_nisha06 is an unknown quantity at this point
Guys,

below code worked for me but, with multiple challenges.

a) If startdate input is echoing from DB, enddate should not display days before the startdate but below code dose not do it. any support is appreciated.

Code:
	<script>
	$(document).ready(function() {
$	(".startdate").datetimepicker({
			showSecond: true,
			dateFormat:'yy-mm-dd',
			timeFormat: 'HH:mm:ss',
			numberOfMonths: 2,
			stepHour: 1,
			stepMinute: 1,
			stepSecond: 1,
        onSelect: function(selected) {
          $(".enddate").datetimepicker("option","minDate", selected)
        }
    });
    $(".enddate").datetimepicker({
			showSecond: true,
			dateFormat:'yy-mm-dd',
			timeFormat: 'HH:mm:ss',
			numberOfMonths: 2,
			stepHour: 1,
			stepMinute: 1,
			stepSecond: 1,
        onSelect: function(selected) {
        $(".startdate").datetimepicker("option","maxDate", selected)
       }
    }); 
});
</script>
nani_nisha06 is offline   Reply With Quote