You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
892 B
29 lines
892 B
var Backbone = require('backbone');
|
|
var ApiData = require('./ApiData');
|
|
|
|
var UiSettings = Backbone.Model.extend({
|
|
url : window.NzbDrone.ApiRoot + '/config/ui',
|
|
|
|
shortDateTime : function(includeSeconds) {
|
|
return this.get('shortDateFormat') + ' ' + this.time(true, includeSeconds);
|
|
},
|
|
|
|
longDateTime : function(includeSeconds) {
|
|
return this.get('longDateFormat') + ' ' + this.time(true, includeSeconds);
|
|
},
|
|
|
|
time : function(includeMinuteZero, includeSeconds) {
|
|
if (includeSeconds) {
|
|
return this.get('timeFormat').replace(/\(?\:mm\)?/, ':mm:ss');
|
|
}
|
|
if (includeMinuteZero) {
|
|
return this.get('timeFormat').replace('(', '').replace(')', '');
|
|
}
|
|
|
|
return this.get('timeFormat').replace(/\(\:mm\)/, '');
|
|
}
|
|
});
|
|
|
|
var instance = new UiSettings(ApiData.get('config/ui'));
|
|
|
|
module.exports = instance; |