Coerce an array of datetime-like values to a CFTimeIndex
    and access requested datetime component

def _access_through_cftimeindex(values, name):
    """Coerce an array of datetime-like values to a CFTimeIndex
    and access requested datetime component
    """
    from ..coding.cftimeindex import CFTimeIndex
    values_as_cftimeindex = CFTimeIndex(values.ravel())
    if name == 'season':
        months = values_as_cftimeindex.month
        field_values = _season_from_months(months)
    else:
        field_values = getattr(values_as_cftimeindex, name)
    return field_values.reshape(values.shape)