mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-25 09:03:12 +03:00
15 lines
421 B
JavaScript
15 lines
421 B
JavaScript
|
import Helper from '@ember/component/helper';
|
||
|
import moment from 'moment';
|
||
|
import {inject as service} from '@ember/service';
|
||
|
|
||
|
export default class MomentSiteTz extends Helper {
|
||
|
@service settings;
|
||
|
|
||
|
compute([date]) {
|
||
|
const today = moment().tz(this.settings.get('timezone'));
|
||
|
const dateMoment = moment.tz(date, this.settings.get('timezone'));
|
||
|
|
||
|
return dateMoment.isSame(today, 'day');
|
||
|
}
|
||
|
}
|