export function mexicanDateFormat(date: Date | string): string {
  const options: Intl.DateTimeFormatOptions = { year: 'numeric', month: 'long', day: 'numeric' };
  const formattedDate = new Date(date).toLocaleDateString('es-MX', options);
  return formattedDate;
}

export function mexicanDateFormatNoYear(date: Date | string): string {
  const options: Intl.DateTimeFormatOptions = { month: 'long', day: 'numeric' };
  const formattedDate = new Date(date).toLocaleDateString('es-MX', options);
  return formattedDate;
}

export function hour(date: Date | string): string {
  const parsedDate = new Date(date);
  let hours = parsedDate.getHours();
  const minutes = parsedDate.getMinutes();
  const ampm = hours >= 12 ? ' PM' : ' AM';
  hours = hours % 12 || 12;
  const formattedHour = `${hours}:${minutes.toString().padStart(2, '0')}${ampm}`;
  return formattedHour;
}

export function numericDateFormat(date: Date | string): string {
  const options: Intl.DateTimeFormatOptions = { year: 'numeric', month: '2-digit', day: '2-digit' };
  const formattedDate = new Date(date).toLocaleDateString('es-MX', options);
  return formattedDate;
}
