FIX: CalendarDateTimeInput renders the wrong day (#27639)

This commit is contained in:
Jan Cernik 2024-06-28 19:18:01 -03:00 committed by GitHub
parent e161086630
commit 0b3b101c97
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -40,7 +40,8 @@ export default class CalendarDateTimeInput extends Component {
if (moment(this.args.date, this._dateFormat).isValid()) {
this._date = this.args.date;
this._picker.setDate(
moment.utc(this._date).format(this._dateFormat),
// using the format YYYY-MM-DD returns the previous day for some timezones
moment.utc(this._date).format("YYYY/MM/DD"),
true
);
} else {