Ghost/ghost/admin/app/helpers/is-moment-today.js
Kevin Ansfield a5fe1fa48c Updated publish complete step copy
refs https://github.com/TryGhost/Team/issues/1598

- pre-fetch post count when reaching the confirm step so it's available once save is complete
- updated copy on complete step to reflect the action that occurred, including the number of published posts when a post was published
- added `{{is-moment-today someDate}}` helper so we can switch between "today" and another date format
2022-05-10 12:51:05 +01:00

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');
}
}