packages/material-ui-lab/src/internal/pickers/date-utils.ts/getFormatAndMaskByViews
export const getFormatAndMaskByViews = (
  views: readonly DatePickerView[],
  utils: MuiPickersAdapter,
) => {
  if (isYearOnlyView(views)) {
    return {
      mask: '____',
      inputFormat: utils.formats.year,
    };
  }

  if (isYearAndMonthViews(views)) {
    return {
      disableMaskedInput: true,
      inputFormat: utils.formats.monthAndYear,
    };
  }

  return {
    mask: '__/__/____',
    inputFormat: utils.formats.keyboardDate,
  };
};