Lidarr/src/UI/Shared/UiSettingsModel.js
2014-08-05 07:30:44 -07:00

30 lines
871 B
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
define(
[
'backbone',
'api!config/ui'
], function (Backbone, uiSettings) {
var UiSettings = Backbone.Model.extend({
url : window.NzbDrone.ApiRoot + '/config/ui',
shortDateTime : function () {
return this.get('shortDateFormat') + ' ' + this.time(true);
},
longDateTime : function () {
return this.get('longDateFormat') + ' ' + this.time(true);
},
time : function (includeMinuteZero) {
if (includeMinuteZero) {
return this.get('timeFormat').replace('(', '').replace(')', '');
}
return this.get('timeFormat').replace(/\(\:mm\)/, '');
}
});
var instance = new UiSettings(uiSettings);
return instance;
});