Function icu_datetime::calendar::convert_if_necessary
source · pub(crate) fn convert_if_necessary<'a>(
any_calendar: &'a AnyCalendar,
value: &impl DateInput<Calendar = AnyCalendar>,
) -> Result<Option<Date<Ref<'a, AnyCalendar>>>, MismatchedCalendarError>
Expand description
Converts a date to the correct calendar if necessary
Returns Err
if the date is not ISO or compatible with the current calendar, returns Ok(None)
if the date is compatible with the current calendar and doesn’t need conversion