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