Added date count function.