diff --git a/src/UI/Handlebars/Helpers/DateTime.js b/src/UI/Handlebars/Helpers/DateTime.js index b784dced3..ca3613d50 100644 --- a/src/UI/Handlebars/Helpers/DateTime.js +++ b/src/UI/Handlebars/Helpers/DateTime.js @@ -61,7 +61,7 @@ define( return ''; } - return moment(input).format(UiSettings.time(false)); + return moment(input).format(UiSettings.time(false, false)); }); Handlebars.registerHelper('LTS', function (input) { @@ -69,7 +69,7 @@ define( return ''; } - return moment(input).format('h:mm:ss A'); + return moment(input).format(UiSettings.time(true, true)); }); Handlebars.registerHelper('if_today', function(context, options) { diff --git a/src/UI/Release/AgeCell.js b/src/UI/Release/AgeCell.js index 6462786c3..1e1c8b795 100644 --- a/src/UI/Release/AgeCell.js +++ b/src/UI/Release/AgeCell.js @@ -13,7 +13,7 @@ define( var age = this.model.get('age'); var ageHours = this.model.get('ageHours'); var published = moment(this.model.get('publishDate')); - var publishedFormatted = published.format('{0} h:mm:ss A'.format(UiSettings.get('shortDateFormat'))); + var publishedFormatted = published.format('{0} {1}'.format(UiSettings.get('shortDateFormat'), UiSettings.time(true, true))); var formatted = age; var suffix = this.plural(age, 'day'); diff --git a/src/UI/Shared/UiSettingsModel.js b/src/UI/Shared/UiSettingsModel.js index 808179019..e732b07ae 100644 --- a/src/UI/Shared/UiSettingsModel.js +++ b/src/UI/Shared/UiSettingsModel.js @@ -8,15 +8,19 @@ define( url : window.NzbDrone.ApiRoot + '/config/ui', - shortDateTime : function () { - return this.get('shortDateFormat') + ' ' + this.time(true); + shortDateTime : function (includeSeconds) { + return this.get('shortDateFormat') + ' ' + this.time(true, includeSeconds); }, - longDateTime : function () { - return this.get('longDateFormat') + ' ' + this.time(true); + longDateTime : function (includeSeconds) { + return this.get('longDateFormat') + ' ' + this.time(true, includeSeconds); }, - time : function (includeMinuteZero) { + time : function (includeMinuteZero, includeSeconds) { + if (includeSeconds) { + return this.get('timeFormat').replace(/\(?\:mm\)?/, ':mm:ss'); + } + if (includeMinuteZero) { return this.get('timeFormat').replace('(', '').replace(')', ''); } diff --git a/src/UI/System/Logs/Table/LogTimeCell.js b/src/UI/System/Logs/Table/LogTimeCell.js index fd558b404..007ab97d4 100644 --- a/src/UI/System/Logs/Table/LogTimeCell.js +++ b/src/UI/System/Logs/Table/LogTimeCell.js @@ -12,7 +12,7 @@ define( render: function () { var date = moment(this._getValue()); - this.$el.html('{0}'.format(date.format(UiSettings.time(true)), date.format(UiSettings.longDateTime()))); + this.$el.html('{0}'.format(date.format(UiSettings.time(true, false)), date.format(UiSettings.longDateTime(true)))); return this; }