2022-05-10 14:51:05 +03:00
|
|
|
import Helper from '@ember/component/helper';
|
2022-09-23 20:15:08 +03:00
|
|
|
import moment from 'moment-timezone';
|
2022-05-10 14:51:05 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
|
|
|
|
2022-05-10 15:26:01 +03:00
|
|
|
export default class IsMomentToday extends Helper {
|
2022-05-10 14:51:05 +03:00
|
|
|
@service settings;
|
|
|
|
|
|
|
|
compute([date]) {
|
2022-10-07 16:23:21 +03:00
|
|
|
const today = moment().tz(this.settings.timezone);
|
|
|
|
const dateMoment = moment.tz(date, this.settings.timezone);
|
2022-05-10 14:51:05 +03:00
|
|
|
|
|
|
|
return dateMoment.isSame(today, 'day');
|
|
|
|
}
|
|
|
|
}
|