Compare time too when detecting ended events (Bug #13368).