mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed the warnings/errors reported by eslint for all the static
javascripts.
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
define('pgadmin.node.pga_schedule', [
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'moment', 'pgadmin.browser', 'alertify',
|
||||
'backform', 'pgadmin.backform'
|
||||
], function(gettext, url_for, $, _, S, pgAdmin, moment, pgBrowser, Alertify, Backform) {
|
||||
'sources/gettext', 'sources/url_for', 'jquery', 'underscore',
|
||||
'underscore.string', 'sources/pgadmin', 'moment', 'pgadmin.browser', 'alertify',
|
||||
'pgadmin.backform', 'pgadmin.backgrid',
|
||||
], function(
|
||||
gettext, url_for, $, _, S, pgAdmin, moment, pgBrowser, Alertify, Backform,
|
||||
Backgrid
|
||||
) {
|
||||
|
||||
if (!pgBrowser.Nodes['coll-pga_schedule']) {
|
||||
pgBrowser.Nodes['coll-pga_schedule'] =
|
||||
@@ -11,7 +14,7 @@ define('pgadmin.node.pga_schedule', [
|
||||
label: gettext('Schedules'),
|
||||
type: 'coll-pga_schedule',
|
||||
columns: ['jscid', 'jscname', 'jscenabled'],
|
||||
hasStatistics: false
|
||||
hasStatistics: false,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -20,7 +23,7 @@ define('pgadmin.node.pga_schedule', [
|
||||
var weekdays = [
|
||||
gettext('Sunday'), gettext('Monday'), gettext('Tuesday'),
|
||||
gettext('Wednesday'), gettext('Thursday'), gettext('Friday'),
|
||||
gettext('Saturday')
|
||||
gettext('Saturday'),
|
||||
],
|
||||
monthdays = [
|
||||
gettext('1st'), gettext('2nd'), gettext('3rd'),
|
||||
@@ -33,13 +36,13 @@ define('pgadmin.node.pga_schedule', [
|
||||
gettext('22nd'), gettext('23rd'), gettext('24th'),
|
||||
gettext('25th'), gettext('26th'), gettext('27th'),
|
||||
gettext('28th'), gettext('29th'), gettext('30th'),
|
||||
gettext('31st'), gettext('Last day')
|
||||
gettext('31st'), gettext('Last day'),
|
||||
],
|
||||
months = [
|
||||
gettext('January'), gettext('February'), gettext('March'),
|
||||
gettext('April'), gettext('May'), gettext('June'),
|
||||
gettext('July'), gettext('August'), gettext('September'),
|
||||
gettext('October'), gettext('November'), gettext('December')
|
||||
gettext('October'), gettext('November'), gettext('December'),
|
||||
],
|
||||
hours = [
|
||||
gettext('00'), gettext('01'), gettext('02'), gettext('03'),
|
||||
@@ -47,7 +50,7 @@ define('pgadmin.node.pga_schedule', [
|
||||
gettext('08'), gettext('09'), gettext('10'), gettext('11'),
|
||||
gettext('12'), gettext('13'), gettext('14'), gettext('15'),
|
||||
gettext('16'), gettext('17'), gettext('18'), gettext('19'),
|
||||
gettext('20'), gettext('21'), gettext('22'), gettext('23')
|
||||
gettext('20'), gettext('21'), gettext('22'), gettext('23'),
|
||||
],
|
||||
minutes = [
|
||||
gettext('00'), gettext('01'), gettext('02'), gettext('03'),
|
||||
@@ -64,21 +67,21 @@ define('pgadmin.node.pga_schedule', [
|
||||
gettext('44'), gettext('45'), gettext('46'), gettext('47'),
|
||||
gettext('48'), gettext('49'), gettext('50'), gettext('51'),
|
||||
gettext('52'), gettext('53'), gettext('54'), gettext('55'),
|
||||
gettext('56'), gettext('57'), gettext('58'), gettext('59')
|
||||
gettext('56'), gettext('57'), gettext('58'), gettext('59'),
|
||||
],
|
||||
AnyDatetimeCell = Backgrid.Extension.MomentCell.extend({
|
||||
editor: Backgrid.Extension.DatetimePickerEditor,
|
||||
render: function() {
|
||||
this.$el.empty();
|
||||
var model = this.model;
|
||||
this.$el.text(this.formatter.fromRaw(model.get(this.column.get("name")), model) || gettext('<any>'));
|
||||
this.$el.text(this.formatter.fromRaw(model.get(this.column.get('name')), model) || gettext('<any>'));
|
||||
this.delegateEvents();
|
||||
|
||||
return this;
|
||||
}
|
||||
},
|
||||
}),
|
||||
DatetimeCell = Backgrid.Extension.MomentCell.extend({
|
||||
editor: Backgrid.Extension.DatetimePickerEditor
|
||||
editor: Backgrid.Extension.DatetimePickerEditor,
|
||||
}),
|
||||
BooleanArrayFormatter = function(selector, indexes) {
|
||||
var self = this;
|
||||
@@ -101,7 +104,7 @@ define('pgadmin.node.pga_schedule', [
|
||||
}
|
||||
|
||||
return self.indexes ? resIdx : res.join(', ');
|
||||
}
|
||||
};
|
||||
this.toRaw = function(d) {
|
||||
if (!self.indexes)
|
||||
return d;
|
||||
@@ -111,14 +114,14 @@ define('pgadmin.node.pga_schedule', [
|
||||
res.push(_.indexOf(d, String(i + 1)) != -1);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
};
|
||||
|
||||
return self;
|
||||
},
|
||||
BooleanArrayOptions = function(ctrl) {
|
||||
var selector = ctrl.field.get('selector'),
|
||||
val = ctrl.model.get(ctrl.field.get('name')),
|
||||
res = [];
|
||||
val = ctrl.model.get(ctrl.field.get('name')),
|
||||
res = [];
|
||||
|
||||
if (selector) {
|
||||
res = _.map(
|
||||
@@ -133,7 +136,7 @@ define('pgadmin.node.pga_schedule', [
|
||||
defaults: {
|
||||
jexid: undefined,
|
||||
jexdate: null,
|
||||
jextime: null
|
||||
jextime: null,
|
||||
},
|
||||
idAttribute: 'jexid',
|
||||
schema: [{
|
||||
@@ -141,20 +144,20 @@ define('pgadmin.node.pga_schedule', [
|
||||
editable: true, placeholder: gettext('<any>'),
|
||||
cell: AnyDatetimeCell, options: {format: 'YYYY-MM-DD'},
|
||||
displayFormat: 'YYYY-MM-DD', modelFormat: 'YYYY-MM-DD',
|
||||
cellHeaderClasses:'width_percent_50', allowEmpty: true
|
||||
cellHeaderClasses:'width_percent_50', allowEmpty: true,
|
||||
},{
|
||||
id: 'jextime', type: 'text', placeholder: gettext('<any>'),
|
||||
label: gettext('Time'), editable: true, cell: AnyDatetimeCell,
|
||||
options: {format: 'HH:mm'}, displayFormat: 'HH:mm',
|
||||
modelFormat: 'HH:mm:ss', displayInUTC: false, allowEmpty: true,
|
||||
cellHeaderClasses:'width_percent_50', modalInUTC: false
|
||||
cellHeaderClasses:'width_percent_50', modalInUTC: false,
|
||||
}],
|
||||
validate: function() {
|
||||
var self = this, exceptions = this.collection,
|
||||
dates = {}, errMsg, hasExceptionErr = false,
|
||||
d = (this.get('jexdate') || '<any>'),
|
||||
t = this.get('jextime') || '<any>',
|
||||
id = this.get('jexid') || this.cid;
|
||||
errMsg, hasExceptionErr = false,
|
||||
d = (this.get('jexdate') || '<any>'),
|
||||
t = this.get('jextime') || '<any>',
|
||||
id = this.get('jexid') || this.cid;
|
||||
|
||||
self.errorModel.unset('jscdate');
|
||||
if (d == t && d == '<any>') {
|
||||
@@ -169,17 +172,17 @@ define('pgadmin.node.pga_schedule', [
|
||||
|
||||
if (
|
||||
d == (ex.get('jexdate') || '<any>') &&
|
||||
t == (ex.get('jextime') || '<any>')
|
||||
t == (ex.get('jextime') || '<any>')
|
||||
) {
|
||||
errMsg = gettext('Please specify unique set of exceptions.');
|
||||
if (ex.errorModel.get('jscdate') != errMsg)
|
||||
self.errorModel.set('jscdate', errMsg);
|
||||
self.errorModel.set('jscdate', errMsg);
|
||||
hasExceptionErr = true;
|
||||
}
|
||||
});
|
||||
|
||||
return errMsg;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
pgBrowser.Nodes['pga_schedule'] = pgBrowser.Node.extend({
|
||||
@@ -189,15 +192,13 @@ define('pgadmin.node.pga_schedule', [
|
||||
hasSQL: true,
|
||||
hasDepends: false,
|
||||
hasStatistics: false,
|
||||
canDrop: function(node) {
|
||||
return true;
|
||||
},
|
||||
canDrop: true,
|
||||
label: gettext('Schedule'),
|
||||
node_image: 'icon-pga_schedule',
|
||||
Init: function() {
|
||||
/* Avoid mulitple registration of menus */
|
||||
if (this.initialized)
|
||||
return;
|
||||
return;
|
||||
|
||||
this.initialized = true;
|
||||
|
||||
@@ -205,17 +206,17 @@ define('pgadmin.node.pga_schedule', [
|
||||
name: 'create_pga_schedule_on_job', node: 'pga_job', module: this,
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Schedule...'),
|
||||
icon: 'wcTabIcon icon-pga_schedule', data: {action: 'create'}
|
||||
icon: 'wcTabIcon icon-pga_schedule', data: {action: 'create'},
|
||||
},{
|
||||
name: 'create_pga_schedule_on_coll', node: 'coll-pga_schedule', module: this,
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Schedule...'),
|
||||
icon: 'wcTabIcon icon-pga_schedule', data: {action: 'create'}
|
||||
icon: 'wcTabIcon icon-pga_schedule', data: {action: 'create'},
|
||||
},{
|
||||
name: 'create_pga_schedule', node: 'pga_schedule', module: this,
|
||||
applies: ['object', 'context'], callback: 'show_obj_properties',
|
||||
category: 'create', priority: 4, label: gettext('Schedule...'),
|
||||
icon: 'wcTabIcon icon-pga_schedule', data: {action: 'create'}
|
||||
icon: 'wcTabIcon icon-pga_schedule', data: {action: 'create'},
|
||||
}]);
|
||||
},
|
||||
model: pgBrowser.Node.Model.extend({
|
||||
@@ -232,7 +233,7 @@ define('pgadmin.node.pga_schedule', [
|
||||
jscmonths: _.map(months, function() { return false; }),
|
||||
jschours: _.map(hours, function() { return false; }),
|
||||
jscminutes: _.map(minutes, function() { return false; }),
|
||||
jscexceptions: []
|
||||
jscexceptions: [],
|
||||
},
|
||||
idAttribute: 'jscid',
|
||||
parse: function(d) {
|
||||
@@ -243,7 +244,7 @@ define('pgadmin.node.pga_schedule', [
|
||||
d.jscexceptions.push({
|
||||
'jexid': d.jexid[idx],
|
||||
'jexdate': d.jexdate[idx],
|
||||
'jextime': d.jextime[idx]
|
||||
'jextime': d.jextime[idx],
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -255,15 +256,15 @@ define('pgadmin.node.pga_schedule', [
|
||||
},
|
||||
schema: [{
|
||||
id: 'jscid', label: gettext('ID'), type: 'int',
|
||||
cellHeaderClasses: 'width_percent_5', mode: ['properties']
|
||||
cellHeaderClasses: 'width_percent_5', mode: ['properties'],
|
||||
},{
|
||||
id: 'jscname', label: gettext('Name'), type: 'text',
|
||||
cellHeaderClasses: 'width_percent_45',
|
||||
disabled: function() { return false; }
|
||||
disabled: function() { return false; },
|
||||
},{
|
||||
id: 'jscenabled', label: gettext('Enabled?'), type: 'switch',
|
||||
disabled: function() { return false; },
|
||||
cellHeaderClasses: 'width_percent_5'
|
||||
cellHeaderClasses: 'width_percent_5',
|
||||
},{
|
||||
id: 'jscstart', label: gettext('Start'), type: 'text',
|
||||
control: 'datetimepicker', cell: DatetimeCell,
|
||||
@@ -271,42 +272,42 @@ define('pgadmin.node.pga_schedule', [
|
||||
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'
|
||||
minDate: moment().add(0, 'm'),
|
||||
}, cellHeaderClasses: 'width_percent_25',
|
||||
},{
|
||||
id: 'jscend', label: gettext('End'), type: 'text',
|
||||
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,
|
||||
minDate: moment().add(0, 'm')
|
||||
minDate: moment().add(0, 'm'),
|
||||
}, cellHeaderClasses: 'width_percent_25',
|
||||
modelFormat: 'YYYY-MM-DD HH:mm:ss Z'
|
||||
modelFormat: 'YYYY-MM-DD HH:mm:ss Z',
|
||||
},{
|
||||
id: 'jscweekdays', label: gettext('Week days'), type: 'text',
|
||||
control: Backform.Control.extend({
|
||||
formatter: new BooleanArrayFormatter(weekdays, false)
|
||||
}), mode: ['properties']
|
||||
formatter: new BooleanArrayFormatter(weekdays, false),
|
||||
}), mode: ['properties'],
|
||||
},{
|
||||
id: 'jscmonthdays', label: gettext('Month days'), type: 'text',
|
||||
control: Backform.Control.extend({
|
||||
formatter: new BooleanArrayFormatter(monthdays, false)
|
||||
}), mode: ['properties']
|
||||
formatter: new BooleanArrayFormatter(monthdays, false),
|
||||
}), mode: ['properties'],
|
||||
},{
|
||||
id: 'jscmonths', label: gettext('Months'), type: 'text',
|
||||
control: Backform.Control.extend({
|
||||
formatter: new BooleanArrayFormatter(months, false)
|
||||
}), mode: ['properties']
|
||||
formatter: new BooleanArrayFormatter(months, false),
|
||||
}), mode: ['properties'],
|
||||
},{
|
||||
id: 'jschours', label: gettext('Hours'), type: 'text',
|
||||
control: Backform.Control.extend({
|
||||
formatter: new BooleanArrayFormatter(hours, false)
|
||||
}), mode: ['properties']
|
||||
formatter: new BooleanArrayFormatter(hours, false),
|
||||
}), mode: ['properties'],
|
||||
},{
|
||||
id: 'jscminutes', label: gettext('Minutes'), type: 'text',
|
||||
control: Backform.Control.extend({
|
||||
formatter: new BooleanArrayFormatter(minutes, false)
|
||||
}), mode: ['properties']
|
||||
formatter: new BooleanArrayFormatter(minutes, false),
|
||||
}), mode: ['properties'],
|
||||
},{
|
||||
id: 'jscexceptions', label: gettext('Exceptions'), type: 'text',
|
||||
control: Backform.Control.extend({
|
||||
@@ -321,17 +322,17 @@ define('pgadmin.node.pga_schedule', [
|
||||
for (; idx < rawData.length; idx++) {
|
||||
d = rawData[idx];
|
||||
if (idx)
|
||||
res += ', ';
|
||||
res += ', ';
|
||||
res += '[' + String((d.jexdate || '') + ' ' + (d.jextime || '')).replace(/^\s+|\s+$/g, '') + ']';
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
this.toRaw = function(data) { return data; }
|
||||
};
|
||||
this.toRaw = function(data) { return data; };
|
||||
|
||||
return this;
|
||||
}
|
||||
}), mode: ['properties']
|
||||
},
|
||||
}), mode: ['properties'],
|
||||
},{
|
||||
type: 'nested', label: gettext('Days'), group: gettext('Repeat'),
|
||||
mode: ['create', 'edit'],
|
||||
@@ -343,13 +344,13 @@ define('pgadmin.node.pga_schedule', [
|
||||
|
||||
this.$el.prepend(
|
||||
'<div class="set-group pg-el-xs-12 ' +
|
||||
Backform.helpMessageClassName + '">' +
|
||||
gettext('Schedules are specified using a <b>cron-style</b> format.<br/><ul><li>For each selected time or date element, the schedule will execute.<br/>e.g. To execute at 5 minutes past every hour, simply select ‘05’ in the Minutes list box.<br/></li><li>Values from more than one field may be specified in order to further control the schedule.<br/>e.g. To execute at 12:05 and 14:05 every Monday and Thursday, you would click minute 05, hours 12 and 14, and weekdays Monday and Thursday.</li><li>For additional flexibility, the Month Days check list includes an extra Last Day option. This matches the last day of the month, whether it happens to be the 28th, 29th, 30th or 31st.</li></ul>') +
|
||||
'</div>'
|
||||
Backform.helpMessageClassName + '">' +
|
||||
gettext('Schedules are specified using a <b>cron-style</b> format.<br/><ul><li>For each selected time or date element, the schedule will execute.<br/>e.g. To execute at 5 minutes past every hour, simply select ‘05’ in the Minutes list box.<br/></li><li>Values from more than one field may be specified in order to further control the schedule.<br/>e.g. To execute at 12:05 and 14:05 every Monday and Thursday, you would click minute 05, hours 12 and 14, and weekdays Monday and Thursday.</li><li>For additional flexibility, the Month Days check list includes an extra Last Day option. This matches the last day of the month, whether it happens to be the 28th, 29th, 30th or 31st.</li></ul>') +
|
||||
'</div>'
|
||||
);
|
||||
|
||||
return res;
|
||||
}
|
||||
},
|
||||
}),
|
||||
schema:[{
|
||||
id: 'jscweekdays', label: gettext('Week Days'), cell: 'select2',
|
||||
@@ -362,11 +363,11 @@ define('pgadmin.node.pga_schedule', [
|
||||
width: 'style',
|
||||
dropdownAdapter: $.fn.select2.amd.require(
|
||||
'select2/selectAllAdapter'
|
||||
)
|
||||
),
|
||||
},
|
||||
selector: weekdays,
|
||||
formatter: new BooleanArrayFormatter(weekdays, true),
|
||||
options: BooleanArrayOptions
|
||||
options: BooleanArrayOptions,
|
||||
},{
|
||||
id: 'jscmonthdays', label: gettext('Month Days'), cell: 'select2',
|
||||
group: gettext('Days'), control: 'select2',
|
||||
@@ -378,10 +379,10 @@ define('pgadmin.node.pga_schedule', [
|
||||
width: 'style',
|
||||
dropdownAdapter: $.fn.select2.amd.require(
|
||||
'select2/selectAllAdapter'
|
||||
)
|
||||
),
|
||||
},
|
||||
formatter: new BooleanArrayFormatter(monthdays, true),
|
||||
selector: monthdays, options: BooleanArrayOptions
|
||||
selector: monthdays, options: BooleanArrayOptions,
|
||||
},{
|
||||
id: 'jscmonths', label: gettext('Months'), cell: 'select2',
|
||||
group: gettext('Days'), control: 'select2',
|
||||
@@ -393,11 +394,11 @@ define('pgadmin.node.pga_schedule', [
|
||||
width: 'style',
|
||||
dropdownAdapter: $.fn.select2.amd.require(
|
||||
'select2/selectAllAdapter'
|
||||
)
|
||||
),
|
||||
},
|
||||
formatter: new BooleanArrayFormatter(months, true),
|
||||
selector: months, options: BooleanArrayOptions
|
||||
}]
|
||||
selector: months, options: BooleanArrayOptions,
|
||||
}],
|
||||
},{
|
||||
type: 'nested', control: 'fieldset', label: gettext('Times'),
|
||||
group: gettext('Repeat'), mode: ['create', 'edit'],
|
||||
@@ -412,10 +413,10 @@ define('pgadmin.node.pga_schedule', [
|
||||
width: 'style',
|
||||
dropdownAdapter: $.fn.select2.amd.require(
|
||||
'select2/selectAllAdapter'
|
||||
)
|
||||
),
|
||||
},
|
||||
formatter: new BooleanArrayFormatter(hours, true),
|
||||
selector: hours, options: BooleanArrayOptions
|
||||
selector: hours, options: BooleanArrayOptions,
|
||||
},{
|
||||
id: 'jscminutes', label: gettext('Minutes'), cell: 'select2',
|
||||
group: gettext('Times'), control: 'select2',
|
||||
@@ -427,26 +428,26 @@ define('pgadmin.node.pga_schedule', [
|
||||
width: 'style',
|
||||
dropdownAdapter: $.fn.select2.amd.require(
|
||||
'select2/selectAllAdapter'
|
||||
)
|
||||
),
|
||||
},
|
||||
formatter: new BooleanArrayFormatter(minutes, true),
|
||||
selector: minutes, options: BooleanArrayOptions
|
||||
}]
|
||||
selector: minutes, options: BooleanArrayOptions,
|
||||
}],
|
||||
},{
|
||||
id: 'jscexceptions', type: 'collection', mode: ['edit', 'create'],
|
||||
label: "", canEdit: false, model: ExceptionModel, canAdd: true,
|
||||
label: '', canEdit: false, model: ExceptionModel, canAdd: true,
|
||||
group: gettext('Exceptions'), canDelete: true,
|
||||
cols: ['jexdate', 'jextime'], control: 'sub-node-collection'
|
||||
cols: ['jexdate', 'jextime'], control: 'sub-node-collection',
|
||||
},{
|
||||
id: 'jscdesc', label: gettext('Comment'), type: 'multiline'
|
||||
id: 'jscdesc', label: gettext('Comment'), type: 'multiline',
|
||||
}],
|
||||
validate: function(keys) {
|
||||
validate: function() {
|
||||
var val = this.get('jscname'),
|
||||
errMsg = null;
|
||||
errMsg = null, msg;
|
||||
|
||||
if (_.isUndefined(val) || _.isNull(val) ||
|
||||
String(val).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = gettext('Name cannot be empty.');
|
||||
msg = gettext('Name cannot be empty.');
|
||||
this.errorModel.set('jscname', msg);
|
||||
errMsg = msg;
|
||||
} else {
|
||||
@@ -456,7 +457,7 @@ define('pgadmin.node.pga_schedule', [
|
||||
val = this.get('jscstart');
|
||||
if (_.isUndefined(val) || _.isNull(val) ||
|
||||
String(val).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = gettext('Please enter the start time.');
|
||||
msg = gettext('Please enter the start time.');
|
||||
this.errorModel.set('jscstart', msg);
|
||||
errMsg = errMsg || msg;
|
||||
} else {
|
||||
@@ -466,7 +467,7 @@ define('pgadmin.node.pga_schedule', [
|
||||
val = this.get('jscend');
|
||||
if (_.isUndefined(val) || _.isNull(val) ||
|
||||
String(val).replace(/^\s+|\s+$/g, '') == '') {
|
||||
var msg = gettext('Please enter the end time.');
|
||||
msg = gettext('Please enter the end time.');
|
||||
this.errorModel.set('jscend', msg);
|
||||
errMsg = errMsg || msg;
|
||||
} else {
|
||||
@@ -476,21 +477,22 @@ define('pgadmin.node.pga_schedule', [
|
||||
// End time must be greater than Start time
|
||||
if(!errMsg) {
|
||||
var start_time = this.get('jscstart'),
|
||||
end_time = this.get('jscend'), elapsed_time,
|
||||
end_time = this.get('jscend'),
|
||||
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);
|
||||
}
|
||||
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