CAL-219 fix sorting tasks events when using advance search