Get the hours and minutes from the decimal time
JavaScript
const getHoursAndMinutes = (value) => [Math.floor(value), Math.floor((value * 60) % 60)]
TypeScript
const getHoursAndMinutes = (value: number): [number, number] => [Math.floor(value), Math.floor((value * 60) % 60)]
Examples
getHoursAndMinutes(4.5) //[4, 30]
getHoursAndMinutes(7.89) // [7, 53]