mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
Cleaned up time formatting
This commit is contained in:
parent
0a8dcaaf16
commit
b0c45aef50
@ -61,11 +61,6 @@ define(
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
var date = moment(input);
|
return moment(input).format(UiSettings.time(false));
|
||||||
if (date.format('mm') === '00') {
|
|
||||||
return date.format('ha');
|
|
||||||
}
|
|
||||||
|
|
||||||
return date.format('h:mma');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -45,7 +45,7 @@ define(
|
|||||||
return date.fromNow();
|
return date.fromNow();
|
||||||
},
|
},
|
||||||
|
|
||||||
pad: function(n, width, z) {
|
pad: function (n, width, z) {
|
||||||
z = z || '0';
|
z = z || '0';
|
||||||
n = n + '';
|
n = n + '';
|
||||||
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
||||||
|
@ -9,11 +9,19 @@ define(
|
|||||||
url : window.NzbDrone.ApiRoot + '/config/ui',
|
url : window.NzbDrone.ApiRoot + '/config/ui',
|
||||||
|
|
||||||
shortDateTime : function () {
|
shortDateTime : function () {
|
||||||
return this.get('shortDateFormat') + ' ' + this.get('timeFormat').replace('(', '').replace(')', '');
|
return this.get('shortDateFormat') + ' ' + this.time(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
longDateTime : function () {
|
longDateTime : function () {
|
||||||
return this.get('longDateFormat') + ' ' + this.get('timeFormat').replace('(', '').replace(')', '');
|
return this.get('longDateFormat') + ' ' + this.time(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
time : function (includeMinuteZero) {
|
||||||
|
if (includeMinuteZero) {
|
||||||
|
return this.get('timeFormat').replace('(', '').replace(')', '');
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.get('timeFormat').replace(/\(\:mm\)/, '');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ define(
|
|||||||
render: function () {
|
render: function () {
|
||||||
|
|
||||||
var date = moment(this._getValue());
|
var date = moment(this._getValue());
|
||||||
this.$el.html('<span title="{1}">{0}</span>'.format(date.format(UiSettings.get('timeFormat').replace('(', '').replace(')', '')), date.format(UiSettings.longDateTime())));
|
this.$el.html('<span title="{1}">{0}</span>'.format(date.format(UiSettings.time(true)), date.format(UiSettings.longDateTime())));
|
||||||
|
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user