mirror of
https://github.com/Prowlarr/Prowlarr.git
synced 2026-04-21 22:25:03 -04:00
31 lines
871 B
JavaScript
31 lines
871 B
JavaScript
'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;
|
|
});
|