changed $apply to $timeout in daterange