updated sortDate and sortTime methods