mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-22 22:14:44 -04:00
UI Cleanup - Updated Shared and Shims subtrees.
This commit is contained in:
@@ -1,25 +1,29 @@
|
||||
var Backbone = require('backbone');
|
||||
var ApiData = require('./ApiData');
|
||||
|
||||
module.exports = (function(){
|
||||
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 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');
|
||||
}
|
||||
});
|
||||
var instance = new UiSettings(ApiData.get('config/ui'));
|
||||
return instance;
|
||||
}).call(this);
|
||||
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;
|
||||
Reference in New Issue
Block a user