powered by
Internal function to check if the input is date, and figure out which date is the latest
get.max.date(mydate)
a vector of dates
an integer returned by `which.max`