MCPcopy Create free account
hub / github.com/Effect-TS/effect / nextMinute

Function nextMinute

packages/effect/src/internal/schedule.ts:1732–1743  ·  view source on GitHub ↗
(now: number, minute: number, initial: boolean)

Source from the content-addressed store, hash-verified

1730
1731/** @internal */
1732export const nextMinute = (now: number, minute: number, initial: boolean): number => {
1733 const date = new Date(now)
1734 if (date.getMinutes() === minute && initial) {
1735 return now
1736 }
1737 if (date.getMinutes() < minute) {
1738 return date.setMinutes(minute)
1739 }
1740 // Set minutes to the provided value and add one hour
1741 const newDate = new Date(date.setMinutes(minute))
1742 return newDate.setTime(newDate.getTime() + 1000 * 60 * 60)
1743}
1744
1745// -----------------------------------------------------------------------------
1746// Hours

Callers 1

minuteOfHourFunction · 0.85

Calls 1

setTimeMethod · 0.65

Tested by

no test coverage detected