export const getTimeOptions = (): string[] => {
  // 10분 간격으로 시간을 생성
  const timeOptions = [];
  for (let i = 0; i < 24; i++) {
    for (let j = 0; j < 60; j += 10) {
      timeOptions.push(`${i < 10 ? `0${i}` : i}:${j < 10 ? `0${j}` : j}`);
    }
  }
  return timeOptions;
};

export const parseTimeOption = (
  time?: string
): { hour: number; minute: number } => {
  if (!time) return { hour: 0, minute: 0 };
  const [hour, minute] = time.split(':').map((t) => parseInt(t, 10));
  return { hour, minute };
};

export const getTimeOption = (time: Date): string => {
  const hour = time.getHours();
  const minute = time.getMinutes();
  return `${hour < 10 ? `0${hour}` : hour}:${minute < 10 ? `0${minute}` : minute}`;
};
