mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
sugar kills (removed sugar.js)
Relative dates for next airing on posters and list (series) History time shows real time on tooltip
This commit is contained in:
parent
641e01376b
commit
207d9c256d
21 changed files with 296 additions and 9100 deletions
|
@ -2,16 +2,24 @@
|
|||
define(
|
||||
[
|
||||
'backgrid',
|
||||
'moment',
|
||||
'Shared/FormatHelpers'
|
||||
], function (Backgrid, FormatHelpers) {
|
||||
], function (Backgrid, Moment, FormatHelpers) {
|
||||
return Backgrid.Cell.extend({
|
||||
className: 'air-date-cell',
|
||||
|
||||
render: function () {
|
||||
|
||||
this.$el.empty();
|
||||
var airDate = this.model.get(this.column.get('name'));
|
||||
this.$el.html(FormatHelpers.DateHelper(airDate));
|
||||
var date = this.model.get(this.column.get('name'));
|
||||
|
||||
if (date) {
|
||||
this.$el.html(FormatHelpers.DateHelper(date));
|
||||
|
||||
//TODO: Figure out why this makes the series grid freak out
|
||||
//this.$el.attr('title', Moment(date).format('LLLL'));
|
||||
}
|
||||
|
||||
return this;
|
||||
|
||||
}
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
define(
|
||||
[
|
||||
'Cells/NzbDroneCell'
|
||||
], function (NzbDroneCell) {
|
||||
'Cells/NzbDroneCell',
|
||||
'Shared/FormatHelpers'
|
||||
], function (NzbDroneCell, FormatHelpers) {
|
||||
return NzbDroneCell.extend({
|
||||
|
||||
className: 'episode-number-cell',
|
||||
|
@ -30,14 +31,14 @@ define(
|
|||
|
||||
if (episodes.constructor === Array) {
|
||||
paddedEpisodes = _.map(episodes,function (episodeNumber) {
|
||||
return episodeNumber.pad(2);
|
||||
return FormatHelpers.pad(episodeNumber, 2);
|
||||
}).join();
|
||||
}
|
||||
else {
|
||||
paddedEpisodes = episodes.pad(2);
|
||||
paddedEpisodes = FormatHelpers.pad(episodes, 2);
|
||||
}
|
||||
|
||||
result = 'S{0}-E{1}'.format(seasonNumber.pad(2), paddedEpisodes);
|
||||
result = '{0}x{1}'.format(seasonNumber, paddedEpisodes);
|
||||
}
|
||||
else if (airDate) {
|
||||
result = new Date(airDate).toLocaleDateString();
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
|
||||
define(
|
||||
[
|
||||
'backgrid'
|
||||
], function (Backgrid) {
|
||||
'backgrid',
|
||||
'moment'
|
||||
], function (Backgrid, Moment) {
|
||||
return Backgrid.Cell.extend({
|
||||
|
||||
className: 'episode-status-cell',
|
||||
|
@ -16,7 +17,7 @@ define(
|
|||
var icon;
|
||||
var tooltip;
|
||||
|
||||
var hasAired = Date.create(this.model.get('airDate')).isBefore(Date.create());
|
||||
var hasAired = Moment(this.model.get('airDate')).isBefore(Moment());
|
||||
var hasFile = this.model.get('hasFile');
|
||||
|
||||
if (hasFile) {
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Cells/NzbDroneCell'
|
||||
], function (NzbDroneCell) {
|
||||
'Cells/NzbDroneCell',
|
||||
'moment',
|
||||
'Shared/FormatHelpers'
|
||||
], function (NzbDroneCell, Moment, FormatHelpers) {
|
||||
return NzbDroneCell.extend({
|
||||
|
||||
className: 'relative-date-cell',
|
||||
|
@ -10,7 +12,11 @@ define(
|
|||
render: function () {
|
||||
|
||||
var date = this.model.get(this.column.get('name'));
|
||||
this.$el.html(Date.create(date).relative());
|
||||
|
||||
if (date) {
|
||||
this.$el.html(FormatHelpers.DateHelper(date));
|
||||
this.$el.attr('title', Moment(date).format('LLLL'));
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
|
|
@ -8,11 +8,13 @@
|
|||
}
|
||||
|
||||
.air-date-cell {
|
||||
width : 100px;
|
||||
width : 120px;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.relative-date-cell {
|
||||
width : 150px;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.quality-cell {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue