Add first and last date generic functions