import isValidDate from 'filters/isValidDate';

export default function toHour(date) {
    if (!isValidDate(date)) {
        return '--:--';
    }
    return (new Date(date || '')).toLocaleTimeString([], {
        hour: '2-digit',
        minute: '2-digit',
    });
}
