mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-29 13:52:10 +03:00
🐛 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:
parent
cc570d23b0
commit
a1457a0b8c
@ -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}}
|
||||
/>
|
||||
|
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user