Fix one-day long allDay events.

master
Tom Hacohen 2017-12-29 12:19:28 +00:00
parent 2056c62b80
commit 78c19fe7c4
1 changed files with 4 additions and 4 deletions

View File

@ -131,15 +131,15 @@ class EventEdit extends React.PureComponent {
const startDate = ICAL.Time.fromString(this.state.start);
let endDate = ICAL.Time.fromString(this.state.end);
if (this.state.allDay) {
endDate.adjust(1, 0, 0, 0);
}
if (startDate.compare(endDate) >= 0) {
this.setState({error: 'End time must be later than start time!'});
return;
}
if (this.state.allDay) {
endDate.adjust(1, 0, 0, 0);
}
let event = (this.props.item) ?
this.props.item.clone()
: