|
|
@ -5,15 +5,39 @@ |
|
|
|
|
|
|
|
var panel = this; |
|
|
|
var theForm = this.getForm(); |
|
|
|
var startInput = Ext.getCmp('user_logs_add_form_start'); |
|
|
|
var hoursInput = Ext.getCmp('user_logs_add_form_hours'); |
|
|
|
var endInput = Ext.getCmp('user_logs_add_form_end'); |
|
|
|
var startdate = startInput.items.items[0]; |
|
|
|
var starttime = startInput.items.items[1]; |
|
|
|
var enddate = endInput.items.items[0]; |
|
|
|
var endtime = endInput.items.items[1]; |
|
|
|
|
|
|
|
console.log(theForm); |
|
|
|
startdate.on('change', function(e){ |
|
|
|
var hours = hoursInput.getValue(); |
|
|
|
var startTime = starttime.getValue(); |
|
|
|
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.HOUR, parseInt(hours)); |
|
|
|
|
|
|
|
var hoursInput = Ext.getCmp('user_logs_add_form_hours'); |
|
|
|
endtime.setValue(calculatedEndTime); |
|
|
|
enddate.setValue(calculatedEndTime); |
|
|
|
}); |
|
|
|
|
|
|
|
console.log(hoursInput); |
|
|
|
starttime.on('change', function(e){ |
|
|
|
var hours = hoursInput.getValue(); |
|
|
|
var startTime = starttime.getValue(); |
|
|
|
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.HOUR, parseInt(hours)); |
|
|
|
|
|
|
|
endtime.setValue(calculatedEndTime); |
|
|
|
enddate.setValue(calculatedEndTime); |
|
|
|
}); |
|
|
|
|
|
|
|
hoursInput.on('change', function(e){ |
|
|
|
console.log('I am changing'); |
|
|
|
var hours = hoursInput.getValue(); |
|
|
|
var startTime = starttime.getValue(); |
|
|
|
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.HOUR, parseInt(hours)); |
|
|
|
|
|
|
|
endtime.setValue(calculatedEndTime); |
|
|
|
enddate.setValue(calculatedEndTime); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|