Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
408 B
1
Indexable
Never
const handleEndTimeSelect = (selectedDate: Date) => {
  const hours = selectedDate.getHours();
  const minutes = selectedDate.getMinutes();

  const formattedHours = hours < 10 ? `0${hours}` : hours.toString();
  const formattedMinutes = minutes < 10 ? `0${minutes}` : minutes.toString();

  const selectedTime = `${formattedHours}:${formattedMinutes}:00`;

  setSelectedEndTime(selectedTime);
};