import { DateTime } from 'luxon' import { EditIcon } from 'lib/icons/Edit.js' import { IconButton } from 'lib/ui/IconButton.js' interface AccessCodeFormTimesProps { startDate: DateTime endDate: DateTime onEdit: () => void } export function AccessCodeFormTimes({ startDate, endDate, onEdit, }: AccessCodeFormTimesProps): JSX.Element { return (
{t.startTimeLabel} {formatDateTime(startDate)} {t.endTimeLabel} {formatDateTime(endDate)}
) } const formatDateTime = (dateTime: DateTime): string => dateTime.toLocaleString(DateTime.DATETIME_FULL_WITH_SECONDS) const t = { startTimeLabel: 'Start', endTimeLabel: 'End', }