mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
🐛 Fixed timezone issue with min/max dates in datetime picker
fixes #15497 `'now'` option for min/max date used `moment()` function and did not consider the timezone of the site.
This commit is contained in:
parent
e871aabb70
commit
220af3b276
1 changed files with 2 additions and 2 deletions
|
@ -121,7 +121,7 @@ export default class GhDateTimePicker extends Component {
|
|||
|
||||
// unless min/max date is at midnight moment will disable that day
|
||||
if (minDate === 'now') {
|
||||
this.set('_minDate', moment(moment().format(DATE_FORMAT)));
|
||||
this.set('_minDate', moment.tz(moment().tz(blogTimezone).format(DATE_FORMAT), blogTimezone));
|
||||
} else if (!isBlank(minDate)) {
|
||||
this.set('_minDate', moment(moment(minDate).format(DATE_FORMAT)));
|
||||
} else {
|
||||
|
@ -129,7 +129,7 @@ export default class GhDateTimePicker extends Component {
|
|||
}
|
||||
|
||||
if (maxDate === 'now') {
|
||||
this.set('_maxDate', moment(moment().format(DATE_FORMAT)));
|
||||
this.set('_maxDate', moment.tz(moment().tz(blogTimezone).format(DATE_FORMAT), blogTimezone));
|
||||
} else if (!isBlank(maxDate)) {
|
||||
this.set('_maxDate', moment(moment(maxDate).format(DATE_FORMAT)));
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue