fixed bug which preventing editing of events which go beyond midnight.