From f03041929fa5f3c412e328a9371cfb47a324c5e1 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Fri, 1 Jul 2022 11:20:02 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fixed=20schedule=20post=20date?= =?UTF-8?q?=20picker=20sometimes=20not=20allowing=20"today"=20to=20be=20se?= =?UTF-8?q?lected?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no issue - with large site timezone UTC offsets it could happen that "today" in the site timezone is not selectable in the date picker when scheduling posts - the problem occurred because we were passing a minimum date to the date picker in UTC which was then converted to a local date using just the "YYYY-MM-DD" data but that would not always be correct because the UTC date could be "tomorrow" compared to the site timezone. Passing in the minimum date in the site timezone rather than UTC ensures the minimum date always matches "today" in the site timezone --- .../admin/app/components/editor/publish-options/publish-at.hbs | 2 +- ghost/admin/app/components/gh-date-time-picker.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ghost/admin/app/components/editor/publish-options/publish-at.hbs b/ghost/admin/app/components/editor/publish-options/publish-at.hbs index 3951188f89..dbad95e48f 100644 --- a/ghost/admin/app/components/editor/publish-options/publish-at.hbs +++ b/ghost/admin/app/components/editor/publish-options/publish-at.hbs @@ -17,7 +17,7 @@ @time={{moment-format (moment-site-tz @publishOptions.scheduledAtUTC) "HH:mm"}} @setDate={{this.setDate}} @setTime={{this.setTime}} - @minDate={{@publishOptions.minScheduledAt}} + @minDate={{moment-site-tz @publishOptions.minScheduledAt}} @isActive={{@publishOptions.isScheduled}} @renderInPlace={{false}} /> diff --git a/ghost/admin/app/components/gh-date-time-picker.js b/ghost/admin/app/components/gh-date-time-picker.js index 1cfdbefaa3..93aa10fa97 100644 --- a/ghost/admin/app/components/gh-date-time-picker.js +++ b/ghost/admin/app/components/gh-date-time-picker.js @@ -119,7 +119,7 @@ export default class GhDateTimePicker extends Component { } this.set('_previousTime', this._time); - // unless min/max date is at midnight moment will diable that day + // unless min/max date is at midnight moment will disable that day if (minDate === 'now') { this.set('_minDate', moment(moment().format(DATE_FORMAT))); } else if (!isBlank(minDate)) {