IS
Size: a a a
IS
j
function calc (source, minutes) {
const [sourceHours, sourceMinutes] = source.split(':')
const minutesInDay = 60 * 24
const sourceTotalMinutes = Number(sourceHours) * 60 + Number(sourceMinutes)
const resultTotalMinutes = ((sourceTotalMinutes + minutes) % minutesInDay + minutesInDay) % minutesInDay
const resultHours = Math.trunc(resultTotalMinutes / 60)
const resultMinutes = resultTotalMinutes % 60
return String(resultHours).padStart(2, 0) + ':' + String(resultMinutes).padStart(2, 0)
}
console.log(calc('23:55', 10))
console.log(calc('00:05', -10))
console.log(calc('12:30', 60 * 24 * 100000))
console.log(calc('12:30', -(60 * 24 * 100000)))
А
ИД
И
J
А
АЧ
А
А
А
А
ИД
j
const extendedPeriodOutput = (period) => {
let total = 0
setInterval(() => {
total += period
console.log(total)
}, period)
}
И
j
А