sort the history list by time