mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 16:31:38 -04:00
Added units to the user time input on the log
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
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 timeInput = Ext.getCmp('user_logs_add_form_time');
|
||||
var unitsInput = Ext.getCmp('user_logs_add_form_units');
|
||||
var endInput = Ext.getCmp('user_logs_add_form_end');
|
||||
var startdate = startInput.items.items[0];
|
||||
var starttime = startInput.items.items[1];
|
||||
@@ -14,27 +15,57 @@
|
||||
var endtime = endInput.items.items[1];
|
||||
|
||||
startdate.on('change', function(e){
|
||||
var hours = hoursInput.getValue();
|
||||
var hours = timeInput.getValue();
|
||||
var startTime = starttime.getValue();
|
||||
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.HOUR, parseInt(hours));
|
||||
|
||||
if('Mins' === unitsInput.getValue()){
|
||||
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.MINUTE, parseInt(hours));
|
||||
}else{
|
||||
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.HOUR, parseInt(hours));
|
||||
}
|
||||
|
||||
endtime.setValue(calculatedEndTime);
|
||||
enddate.setValue(calculatedEndTime);
|
||||
});
|
||||
|
||||
starttime.on('change', function(e){
|
||||
var hours = hoursInput.getValue();
|
||||
var hours = timeInput.getValue();
|
||||
var startTime = starttime.getValue();
|
||||
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.HOUR, parseInt(hours));
|
||||
|
||||
if('Mins' === unitsInput.getValue()){
|
||||
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.MINUTE, parseInt(hours));
|
||||
}else{
|
||||
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.HOUR, parseInt(hours));
|
||||
}
|
||||
|
||||
|
||||
endtime.setValue(calculatedEndTime);
|
||||
enddate.setValue(calculatedEndTime);
|
||||
});
|
||||
|
||||
hoursInput.on('change', function(e){
|
||||
var hours = hoursInput.getValue();
|
||||
timeInput.on('change', function(e){
|
||||
var hours = timeInput.getValue();
|
||||
var startTime = starttime.getValue();
|
||||
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.HOUR, parseInt(hours));
|
||||
|
||||
if('Mins' === unitsInput.getValue()){
|
||||
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.MINUTE, parseInt(hours));
|
||||
}else{
|
||||
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.HOUR, parseInt(hours));
|
||||
}
|
||||
|
||||
endtime.setValue(calculatedEndTime);
|
||||
enddate.setValue(calculatedEndTime);
|
||||
});
|
||||
|
||||
unitsInput.on('change', function(e){
|
||||
var hours = timeInput.getValue();
|
||||
var startTime = starttime.getValue();
|
||||
|
||||
if('Mins' === unitsInput.getValue()){
|
||||
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.MINUTE, parseInt(hours));
|
||||
}else{
|
||||
var calculatedEndTime = Ext.Date.add(new Date(startTime), Ext.Date.HOUR, parseInt(hours));
|
||||
}
|
||||
|
||||
endtime.setValue(calculatedEndTime);
|
||||
enddate.setValue(calculatedEndTime);
|
||||
|
||||
Reference in New Issue
Block a user