🐛 Fixed schedule post date picker sometimes not allowing "today" to be selected

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
This commit is contained in:
Kevin Ansfield 2022-07-01 11:20:02 +01:00 committed by Daniel Lockyer
parent cc570d23b0
commit a1457a0b8c
2 changed files with 2 additions and 2 deletions

View File

@ -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}}
/>

View File

@ -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)) {