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

Function nextMinute

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

Source from the content-addressed store, hash-verified

1722
1723/** @internal */
1724export const nextMinute = (now: number, minute: number, initial: boolean): number => {
1725 const date = new Date(now)
1726 if (date.getMinutes() === minute && initial) {
1727 return now
1728 }
1729 if (date.getMinutes() < minute) {
1730 return date.setMinutes(minute)
1731 }
1732 // Set minutes to the provided value and add one hour
1733 const newDate = new Date(date.setMinutes(minute))
1734 return newDate.setTime(newDate.getTime() + 1000 * 60 * 60)
1735}
1736
1737// -----------------------------------------------------------------------------
1738// Hours

Callers 1

minuteOfHourFunction · 0.85

Calls 1

setTimeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…