7c2e923074
refs https://github.com/TryGhost/Ghost/pull/6941#issuecomment-224553575 - `blogTimezone` and `timezone` better reflect their values (a string representing a timezone in the format `Europe/Dublin`) than `offset` which suggests a fixed value
29 lines
647 B
JavaScript
29 lines
647 B
JavaScript
import Ember from 'ember';
|
|
|
|
const {
|
|
Service,
|
|
computed,
|
|
inject: {service}
|
|
} = Ember;
|
|
|
|
export default Service.extend({
|
|
store: service(),
|
|
|
|
_parseTimezones(settings) {
|
|
let activeTimezone = settings.get('activeTimezone');
|
|
return activeTimezone;
|
|
},
|
|
|
|
_settings: computed(function () {
|
|
let store = this.get('store');
|
|
return store.queryRecord('setting', {type: 'blog,theme,private'});
|
|
}),
|
|
|
|
blogTimezone: computed('_settings.activeTimezone', function () {
|
|
return this.get('_settings').then((settings) => {
|
|
return this._parseTimezones(settings);
|
|
});
|
|
})
|
|
|
|
});
|