User283571144 posted
Hi Bakhtawar,
in this date time picker when i select time i.e. i select 01:02 then on from date also time changes to 01:02 where as i want when i change time from date then this time can not reflect on todate
According to your description and codes. I can't understand your requirement clearly.
Could you explain more about "i select 01:02 then on from date also time changes to 01:02"?
If you select the date in fromdate textbox, the date will show in the fromdate txtbox.
Could you please explain more about this time can't reflect on todate?
Do you mean your requirement as below example?
fromdate textbox
You select 2016-9-10 00:00
Then in todate textbox
It will automatic changed to 2016-9-10 00:00.
If you don't want to changing the todate textbox value, you could delete fromdate's onSelect fucnion.
More details, you could refer to follow codes:
<script type="text/javascript">
$(function () {
var currentYear = (new Date).getFullYear();
var currentMonth = (new Date).getMonth();
var currentDay = (new Date).getDate();
$('#fromdate').datetimepicker({
showSecond: false,
timeFormat: 'HH:mm',
minDate: new Date((currentYear - 2), 12, 1),
//minDate: 0,
dateFormat: 'yy-mm-dd',
maxDate: new Date(currentYear, currentMonth, currentDay),
//maxDate: new Date((currentYear + 1), 12, 1),
});
$('#todate').datetimepicker({
showSecond: false,
timeFormat: 'HH:mm',
minDate: new Date((currentYear - 2), 12, 1),
minDate: 0,
dateFormat: 'yy-mm-dd',
maxDate: '+30',
//maxDate: endDate.setMonth(endDate.getMonth() + 2)
});
});
</script>
Besides, if I misunderstand your requirement, please tell me more about it.
Best Regards,
Brando