diff --git a/src/UI/Handlebars/Helpers/DateTime.js b/src/UI/Handlebars/Helpers/DateTime.js index 28b8fdf49..ff7f7174f 100644 --- a/src/UI/Handlebars/Helpers/DateTime.js +++ b/src/UI/Handlebars/Helpers/DateTime.js @@ -61,11 +61,6 @@ define( return ''; } - var date = moment(input); - if (date.format('mm') === '00') { - return date.format('ha'); - } - - return date.format('h:mma'); + return moment(input).format(UiSettings.time(false)); }); }); diff --git a/src/UI/Shared/FormatHelpers.js b/src/UI/Shared/FormatHelpers.js index 7b1e35417..8881b82b2 100644 --- a/src/UI/Shared/FormatHelpers.js +++ b/src/UI/Shared/FormatHelpers.js @@ -45,7 +45,7 @@ define( return date.fromNow(); }, - pad: function(n, width, z) { + pad: function (n, width, z) { z = z || '0'; n = n + ''; return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; diff --git a/src/UI/Shared/UiSettingsModel.js b/src/UI/Shared/UiSettingsModel.js index 5d9cda590..808179019 100644 --- a/src/UI/Shared/UiSettingsModel.js +++ b/src/UI/Shared/UiSettingsModel.js @@ -9,11 +9,19 @@ define( url : window.NzbDrone.ApiRoot + '/config/ui', shortDateTime : function () { - return this.get('shortDateFormat') + ' ' + this.get('timeFormat').replace('(', '').replace(')', ''); + return this.get('shortDateFormat') + ' ' + this.time(true); }, 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\)/, ''); } }); diff --git a/src/UI/System/Logs/Table/LogTimeCell.js b/src/UI/System/Logs/Table/LogTimeCell.js index 25b4134e0..fd558b404 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.get('timeFormat').replace('(', '').replace(')', '')), date.format(UiSettings.longDateTime()))); + this.$el.html('{0}'.format(date.format(UiSettings.time(true)), date.format(UiSettings.longDateTime()))); return this; }