packages/material-ui-lab/src/internal/pickers/time-utils.ts/convertValueToMeridiem
export const convertValueToMeridiem = (value: number, meridiem: Meridiem, ampm: boolean) => {
  if (ampm) {
    const currentMeridiem = value >= 12 ? 'pm' : 'am';
    if (currentMeridiem !== meridiem) {
      return meridiem === 'am' ? value - 12 : value + 12;
    }
  }

  return value;
};