/** * Parses a time string to minutes since the start of the week. * * @param {string} time - A string representing time * in "HH:MM" format or as a single number in hours. * @returns {number} The total minutes since the start of the week. */ const parseTimeToMinutes = (time: string): number => { if (time.includes(':')) { const [ hours, minutes, ] = time.split(':').map(Number) return hours * 60 + minutes } return Number(time) * 60 // Convert hours directly to minutes for simplicity. } export default parseTimeToMinutes