Fix event editing.

It was crashing due to 7917b1fbe1.
master
Tom Hacohen 7 years ago
parent 5690906f6b
commit 71f7df252a

@ -63,14 +63,16 @@ class EventEdit extends React.PureComponent {
}; };
const locState = this.props.location.state; const locState = this.props.location.state;
// FIXME: Hack to determine if all day. Should be passed as a proper state. if (locState) {
this.state.allDay = (locState.start && // FIXME: Hack to determine if all day. Should be passed as a proper state.
(locState.start.getHours() === 0) && this.state.allDay = (locState.start &&
(locState.start.getMinutes() === 0) && (locState.start.getHours() === 0) &&
(locState.start.getHours() === locState.end.getHours()) && (locState.start.getMinutes() === 0) &&
(locState.start.getMinutes() === locState.end.getMinutes())); (locState.start.getHours() === locState.end.getHours()) &&
this.state.start = (locState.start) ? locState.start : undefined; (locState.start.getMinutes() === locState.end.getMinutes()));
this.state.end = (locState.end) ? locState.end : undefined; this.state.start = (locState.start) ? locState.start : undefined;
this.state.end = (locState.end) ? locState.end : undefined;
}
if (this.props.item !== undefined) { if (this.props.item !== undefined) {
const event = this.props.item; const event = this.props.item;

Loading…
Cancel
Save