mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-19 21:44:30 -04:00
rjs -> webpack
This commit is contained in:
@@ -1,46 +1,31 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Cells/NzbDroneCell',
|
||||
'moment',
|
||||
'Shared/UiSettingsModel'
|
||||
], function (NzbDroneCell, moment, UiSettings) {
|
||||
return NzbDroneCell.extend({
|
||||
var NzbDroneCell = require('../../Cells/NzbDroneCell');
|
||||
var moment = require('moment');
|
||||
var UiSettings = require('../../Shared/UiSettingsModel');
|
||||
|
||||
className: 'next-execution-cell',
|
||||
|
||||
render: function () {
|
||||
|
||||
this.$el.empty();
|
||||
|
||||
var interval = this.model.get('interval');
|
||||
var nextExecution = moment(this.model.get('nextExecution'));
|
||||
|
||||
if (interval === 0 ) {
|
||||
this.$el.html('-');
|
||||
}
|
||||
|
||||
else if (moment().isAfter(nextExecution)) {
|
||||
this.$el.html('now');
|
||||
}
|
||||
|
||||
else {
|
||||
var result = '<span title="{0}">{1}</span>';
|
||||
var tooltip = nextExecution.format(UiSettings.longDateTime());
|
||||
var text;
|
||||
|
||||
if (UiSettings.get('showRelativeDates')) {
|
||||
text = nextExecution.fromNow();
|
||||
}
|
||||
|
||||
else {
|
||||
text = nextExecution.format(UiSettings.shortDateTime());
|
||||
}
|
||||
|
||||
this.$el.html(result.format(tooltip, text));
|
||||
}
|
||||
|
||||
return this;
|
||||
module.exports = NzbDroneCell.extend({
|
||||
className : 'next-execution-cell',
|
||||
render : function(){
|
||||
this.$el.empty();
|
||||
var interval = this.model.get('interval');
|
||||
var nextExecution = moment(this.model.get('nextExecution'));
|
||||
if(interval === 0) {
|
||||
this.$el.html('-');
|
||||
}
|
||||
else if(moment().isAfter(nextExecution)) {
|
||||
this.$el.html('now');
|
||||
}
|
||||
else {
|
||||
var result = '<span title="{0}">{1}</span>';
|
||||
var tooltip = nextExecution.format(UiSettings.longDateTime());
|
||||
var text;
|
||||
if(UiSettings.get('showRelativeDates')) {
|
||||
text = nextExecution.fromNow();
|
||||
}
|
||||
});
|
||||
});
|
||||
else {
|
||||
text = nextExecution.format(UiSettings.shortDateTime());
|
||||
}
|
||||
this.$el.html(result.format(tooltip, text));
|
||||
}
|
||||
return this;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user