mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Misc fixes for the pgAgent module:
1) User was allowed to enter start date ahead of end date while scheduling a job. Fixes #2921 2) Datetime picker was not displaying in the grid (sub-node collection control). Fixes #1749 3) Fixed UI issue where validation error was not displaying properly for Datetime control.
This commit is contained in:
committed by
Dave Page
parent
c74b348bac
commit
f5718b9d56
@@ -77,6 +77,9 @@ define('pgadmin.node.pga_schedule', [
|
||||
return this;
|
||||
}
|
||||
}),
|
||||
DatetimeCell = Backgrid.Extension.MomentCell.extend({
|
||||
editor: Backgrid.Extension.DatetimePickerEditor
|
||||
}),
|
||||
BooleanArrayFormatter = function(selector, indexes) {
|
||||
var self = this;
|
||||
|
||||
@@ -263,18 +266,20 @@ define('pgadmin.node.pga_schedule', [
|
||||
cellHeaderClasses: 'width_percent_5'
|
||||
},{
|
||||
id: 'jscstart', label: gettext('Start'), type: 'text',
|
||||
control: 'datetimepicker', cell: 'moment',
|
||||
control: 'datetimepicker', cell: DatetimeCell,
|
||||
disabled: function() { return false; }, displayInUTC: false,
|
||||
displayFormat: 'YYYY-MM-DD HH:mm:ss Z',
|
||||
modelFormat: 'YYYY-MM-DD HH:mm:ss Z', options: {
|
||||
format: 'YYYY-MM-DD HH:mm:ss Z',
|
||||
minDate: moment().add(0, 'm')
|
||||
}, cellHeaderClasses: 'width_percent_25'
|
||||
},{
|
||||
id: 'jscend', label: gettext('End'), type: 'text',
|
||||
control: 'datetimepicker', cell: 'moment',
|
||||
control: 'datetimepicker', cell: DatetimeCell,
|
||||
disabled: function() { return false; }, displayInUTC: false,
|
||||
displayFormat: 'YYYY-MM-DD HH:mm:ss Z', options: {
|
||||
format: 'YYYY-MM-DD HH:mm:ss Z', useCurrent: false
|
||||
format: 'YYYY-MM-DD HH:mm:ss Z', useCurrent: false,
|
||||
minDate: moment().add(0, 'm')
|
||||
}, cellHeaderClasses: 'width_percent_25',
|
||||
modelFormat: 'YYYY-MM-DD HH:mm:ss Z'
|
||||
},{
|
||||
@@ -468,6 +473,21 @@ define('pgadmin.node.pga_schedule', [
|
||||
this.errorModel.unset('jscend');
|
||||
}
|
||||
|
||||
// End time must be greater than Start time
|
||||
if(!errMsg) {
|
||||
var start_time = this.get('jscstart'),
|
||||
end_time = this.get('jscend'), elapsed_time,
|
||||
start_time_js = start_time.split(' '),
|
||||
end_time_js = end_time.split(' ');
|
||||
start_time_js = moment(start_time_js[0] + ' ' + start_time_js[1]);
|
||||
end_time_js = moment(end_time_js[0] + ' ' + end_time_js[1]);
|
||||
|
||||
if(end_time_js.isBefore(start_time_js)) {
|
||||
errMsg = gettext('Start time must be less than end time');
|
||||
this.errorModel.set('jscstart', errMsg);
|
||||
}
|
||||
}
|
||||
|
||||
return errMsg;
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user