diff --git a/client/components/fields/editor/EventSchedule.tsx b/client/components/fields/editor/EventSchedule.tsx index d54fb470c..0fec93088 100644 --- a/client/components/fields/editor/EventSchedule.tsx +++ b/client/components/fields/editor/EventSchedule.tsx @@ -88,6 +88,7 @@ export class EditorFieldEventSchedule extends React.PureComponent { 'dates.end': endDate ? localDateToUtc(endDate, this.props.item?.dates?.tz) : null, 'dates.all_day': true, 'dates.no_end_time': false, + [TO_BE_CONFIRMED_FIELD]: false, }; this.props.onChange(changes); @@ -99,10 +100,10 @@ export class EditorFieldEventSchedule extends React.PureComponent { 'dates.start': newStartDate, 'dates.all_day': false, 'dates.no_end_time': this.props.item.dates.no_end_time ?? true, + [TO_BE_CONFIRMED_FIELD]: false, }; changes['_startTime'] = newStartDate; - this.setToBeConfirmed(changes); this.props.onChange(changes); } @@ -143,6 +144,7 @@ export class EditorFieldEventSchedule extends React.PureComponent { : null, 'dates.all_day': !hasStartTime, 'dates.no_end_time': hasStartTime, + [TO_BE_CONFIRMED_FIELD]: false, }; this.props.onChange(changes); @@ -159,19 +161,12 @@ export class EditorFieldEventSchedule extends React.PureComponent { 'dates.end': newEndDate, 'dates.all_day': false, 'dates.no_end_time': false, + [TO_BE_CONFIRMED_FIELD]: false, }; - this.setToBeConfirmed(changes); this.props.onChange(changes); } - setToBeConfirmed(changes) { - if ((changes['_startTime'] || this.props.item._startTime) && - (changes['_endTime'] || this.props.item._endTime)) { - changes[TO_BE_CONFIRMED_FIELD] = false; - } - } - changeTimezone(_: string, timezone?: string) { const dtFormat = 'DD/MM/YYYY HH:mm'; const dates = this.props.item?.dates ?? {};