MCPcopy Create free account

hub / github.com/Hexagon/croner / functions

Functions140 in github.com/Hexagon/croner

↓ 37 callersMethodgetTime
* Convert current state back to a javascript Date() and return UTC milliseconds
src/date.ts:1125
↓ 27 callersMethodnextRuns
* Find next n runs, based on supplied date. Strips milliseconds. * * @param n - Number of runs to enumerate * @param previous - Date to start
src/croner.ts:320
↓ 26 callersMethodgetDate
* Convert current state back to a javascript Date() * * @param internal If this is an internal call
src/date.ts:1060
↓ 25 callersMethodnextRun
* Find next runtime, based on supplied date. Strips milliseconds. * * @param prev - Optional. Date to start from. Can be a CronDate, Date object
src/croner.ts:309
↓ 13 callersMethodstop
* Stop execution * * Running this will forcefully stop the job, and prevent furter exection. `.resume()` will not work after stopping. * It w
src/croner.ts:499
↓ 10 callersMethodgetTz
* Internal helper to get the timezone or UTC offset for date operations. * Reduces duplication of `this.options.timezone || this.options.utcOffset`
src/croner.ts:139
↓ 10 callersMethodparse
* Parse current pattern, will throw on any type of failure * @private
src/pattern.ts:120
↓ 10 callersMethodpreviousRuns
* Find previous n runs before the supplied date (at least `interval` seconds before, if set). A * run earlier in the same second as the reference i
src/croner.ts:336
↓ 9 callersMethodmsToNext
* Returns number of milliseconds to next run * * @param prev Starting date, defaults to now - minimum interval
src/croner.ts:487
↓ 8 callersMethodgetLastDayOfMonth
* Calculates the last day of a given month. * Uses a performance optimization for months other than February. * * @param year The year * @
src/date.ts:144
↓ 8 callersMethodschedule
* Schedule a new job * * @param func - Function to be run each iteration of pattern
src/croner.ts:545
↓ 8 callersFunctionutcTime
( year: number, month: number, day: number, hour = 0, minute = 0, second = 0, millisecond = 0, )
src/helpers/calendar.ts:9
↓ 7 callersMethodapply
* Reset internal parameters (seconds, minutes, hours) if any of them have exceeded (or could have exceeded) their normal ranges * * Will alway r
src/date.ts:353
↓ 6 callersFunctioncreateTimePoint
( y: number, m: number, d: number, h: number, i: number, s: number, tz?: string, )
src/helpers/timezone.ts:387
↓ 6 callersFunctiontoTZ
(d: Date, tzStr?: string)
src/helpers/timezone.ts:277
↓ 5 callersMethod_nextTarget
* Find the next time the job runs, after a reference (default: now). With dayOffset, the * pattern is searched in shifted time, so the reference, s
src/croner.ts:177
↓ 5 callersMethod_toMs
* The exact instant of a reference date. Strings are read in the timezone of the job.
src/croner.ts:797
↓ 5 callersMethodmatch
* Check if a given date matches the cron pattern * * @param date - Date to check. Can be a Date object or a string representing a date. * @re
src/croner.ts:390
↓ 4 callersMethod_offsetMs
* The dayOffset option in milliseconds
src/croner.ts:158
↓ 4 callersMethodenumerate
* Create a stateful iterator for sequential date traversal of this schedule. * * Returns a {@link CronIterator} that implements both the ECMAScr
src/croner.ts:352
↓ 4 callersMethodextractNth
(conf: string, type: string)
src/pattern.ts:588
↓ 4 callersFunctionfromTZ
(tp: TimePoint, throwOnInvalid?: boolean)
src/helpers/timezone.ts:152
↓ 4 callersFunctionisFunction
* Helper function to check if a variable is a function. * * @param v The variable to check. * @returns True if the variable is a function, false ot
src/utils.ts:10
↓ 4 callersMethodisRunning
* Indicates whether or not the cron job is scheduled and running, e.g. awaiting next trigger * * @returns Running or not
src/croner.ts:441
↓ 4 callersMethodnext
* Returns the next scheduled date and advances the cursor. * Implements the ECMAScript Iterator protocol. * * @returns `{ value: Date, done:
src/croner.ts:991
↓ 4 callersMethodsetPart
* Set a specific value for a specific part of the CronPattern. * * @param part The specific part of the CronPattern, e.g., "second", "minute", e
src/pattern.ts:433
↓ 3 callersMethod_checkTrigger
* Called when it's time to trigger. * Checks if all conditions are currently met, * then instantly triggers the scheduled function.
src/croner.ts:663
↓ 3 callersMethod_findOccurrence
* Find the first occurrence after (direction 1) or before (direction -1) referenceMs, * walking the wall clock from `start`. Same algorithm as find
src/croner.ts:812
↓ 3 callersMethodapplyDayOffset
* Internal helper to apply dayOffset to a date if configured. * * @param date - The base date to apply offset to * @returns The date with day
src/croner.ts:150
↓ 3 callersMethodgetPattern
* Return the original pattern, if there was one. * Returns undefined when the job was created with a Date or ISO 8601 string instead of a cron patt
src/croner.ts:419
↓ 3 callersFunctionresolveLocal
(tp: TimePoint)
src/helpers/timezone.ts:178
↓ 3 callersMethodrunsLeft
* Returns number of runs left, undefined = unlimited
src/croner.ts:654
↓ 3 callersMethodtoNumber
* Read a number that is nothing but digits. parseInt stops at the first other character, so it * would read "15W5" as 15 and "3*" as 3. * * @
src/pattern.ts:488
↓ 3 callersMethodvalidateNotNaN
* Validates that a parsed number is not NaN. * Throws a TypeError with a descriptive message if the value is NaN. * * @param value - The valu
src/pattern.ts:501
↓ 3 callersMethodvalidateRange
* Validates that a range is valid (lower <= upper) and that steps are valid (> 0 and <= array length). * * @param lower - Lower bound of range
src/pattern.ts:518
↓ 2 callersMethod_enumerateRuns
* Internal helper to enumerate runs in either direction. * * @param n - Number of runs to enumerate * @param startDate - Date to start from
src/croner.ts:365
↓ 2 callersMethod_findMatch
* Internal unified method to find a matching time component in either direction. * This method searches through the pattern to find the next or pre
src/date.ts:516
↓ 2 callersMethod_matchDayValue
* Evaluate whether a specific day value matches, applying all day-specific * special-case logic (W, LW, L modifiers and DOW AND/OR combination).
src/date.ts:429
↓ 2 callersMethod_schedule
(func?: CronCallback<T>, now?: Date)
src/croner.ts:549
↓ 2 callersMethod_shift
* Move a run time back by dayOffset, to the pattern match it was shifted from
src/croner.ts:208
↓ 2 callersMethod_trigger
* Internal function to trigger a run, used by both scheduled and manual trigger
src/croner.ts:603
↓ 2 callersMethodcurrentRun
* Return current/previous run start time * * @returns Current (if running) or previous run time
src/croner.ts:469
↓ 2 callersFunctionfindOffsetChange
(fromMs: number, toMs: number, tz?: string)
src/helpers/timezone.ts:237
↓ 2 callersMethodfromDate
* Sets internals using a Date
src/date.ts:261
↓ 2 callersFunctionfromTZISO
(localTimeStr: string, tz?: string, throwOnInvalid?: boolean)
src/helpers/timezone.ts:139
↓ 2 callersMethodgetOnce
* Return the original run-once date, if there was one * * @returns Original run-once date, or null if not a run-once job
src/croner.ts:432
↓ 2 callersFunctionhasUtcDesignator
(dtStr: string)
src/helpers/timezone.ts:50
↓ 2 callersMethodisBusy
* Indicates whether or not the cron job is currently working * * @returns Running or not
src/croner.ts:460
↓ 2 callersMethodmatch
* Check if the current CronDate matches a cron pattern * * @param pattern The cron pattern to match against * @param options The cron options
src/date.ts:1136
↓ 2 callersMethodreset
* Resets the cursor, optionally to a new starting date. * * @param newStartAt - New starting date. Defaults to current time if omitted.
src/croner.ts:1023
↓ 2 callersFunctionsleep
(ms: number)
test/utils.ts:17
↓ 2 callersFunctiontimePointToMs
* Helper function to convert TimePoint components to UTC milliseconds * * @param tp - TimePoint to convert * @returns Milliseconds since epoch (UTC
src/helpers/timezone.ts:29
↓ 2 callersFunctiontimeout
(timeoutMs: number, fn: Function)
test/utils.ts:2
↓ 2 callersMethodtrigger
* Trigger a run manually
src/croner.ts:647
↓ 2 callersFunctionuseClock
(initialTime: number)
test/clockstep.test.ts:5
↓ 2 callersFunctionutcOffsetMs
* Helper function to get the UTC offset of a timezone at an instant * * @returns Offset in milliseconds, local time minus UTC
src/helpers/timezone.ts:225
↓ 1 callersFunctionCronOptionsHandler
* Processes and validates cron options. * * @param options The cron options to handle. * @returns The processed and validated cron options. * @thr
src/options.ts:176
↓ 1 callersMethod_calculatePreviousRun
* When startAt and interval are set and there is no previous run, find the last run there * would have been between startAt and now. Returns undefi
src/croner.ts:941
↓ 1 callersMethod_next
* Internal version of next. Cron needs millseconds internally, hence _next.
src/croner.ts:689
↓ 1 callersMethod_previous
* Internal version of previous. Finds the previous scheduled run time. * * @param referenceDate - Optional reference date to search backwards fr
src/croner.ts:763
↓ 1 callersMethod_previousTarget
* Find the previous time the job ran, before a reference (default: now). See _nextTarget.
src/croner.ts:192
↓ 1 callersMethod_runAt
* When a matching wall clock time runs, if that is after (direction 1) or * before (direction -1) referenceMs. DST rules, shared with croner-rust:
src/croner.ts:899
↓ 1 callersMethod_walk
* Walk the wall clock from `start` until a time matches the pattern, and runs after * (direction 1) or before (direction -1) referenceMs. Same algo
src/croner.ts:866
↓ 1 callersMethodcacheInstant
* Remember the instant the current fields were created from
src/date.ts:313
↓ 1 callersMethodcachedInstant
* The cached instant, or undefined if there is none or the fields have changed since caching
src/date.ts:322
↓ 1 callersFunctiond
(v: T | undefined, fallback: T)
src/options.ts:194
↓ 1 callersMethoddecrement
* Decrement to previous run time * * @param pattern The pattern used to decrement the current date. * @param options Cron options used for de
src/date.ts:747
↓ 1 callersMethodfindNext
* Find next match of current part
src/date.ts:407
↓ 1 callersMethodfindPrevious
* Find previous match for a specific component going backwards in time. * This is the backward equivalent of the findNext() method. * * @para
src/date.ts:1046
↓ 1 callersFunctionfirstRunAt
* Schedules a job on a fake clock starting at `startTime`, follows the armed timers, and * returns when the job first runs, or null if it doesn't run
test/clockstep.test.ts:134
↓ 1 callersFunctionfoldOf
(ms: number, tz?: string)
src/helpers/timezone.ts:255
↓ 1 callersMethodfromCronDate
* Sets internals by deep copying another CronDate * * @param {CronDate} d - Input date
src/date.ts:335
↓ 1 callersMethodfromString
* Sets internals by parsing a string
src/date.ts:382
↓ 1 callersFunctionfromTimezone
( y: number, m: number, d: number, h: number, i: number, s: number, tz: string, throwOnInvalid
src/helpers/timezone.ts:118
↓ 1 callersMethodgetLastWeekday
* Calculates the last weekday (Mon-Fri) of a given month. * * @param year The target year. * @param month The target month (0-11). * @retu
src/date.ts:161
↓ 1 callersMethodgetMaxPatternValue
* Get the maximum value in a pattern for a given target. * Used when resetting components during backward recursion. * * @param target The ta
src/date.ts:1009
↓ 1 callersMethodgetNearestWeekday
* Calculates the nearest weekday (Mon-Fri) to a given day of the month. * Handles month boundaries. * * @param year The target year. * @pa
src/date.ts:185
↓ 1 callersMethodhandleNicknames
* Replace nicknames with actual cron patterns * * @param pattern Pattern, may contain nicknames, or not * * @returns Pattern, with cron ex
src/pattern.ts:807
↓ 1 callersMethodhandleNumber
* Nothing but a number, potentially with a modifier, left - handle that * * @param conf Current part, expected to be a number, as a string *
src/pattern.ts:394
↓ 1 callersMethodhandleRange
* Take care of ranges (e.g. 1-20) * * @param conf - Current part, expected to be a string like 1-20, can contain L for last * @param type - O
src/pattern.ts:621
↓ 1 callersMethodhandleRangeWithStepping
* Take care of ranges with stepping (e.g. 3-23/5) * * @param conf Current part, expected to be a string like 3-23/5 * @param type One of "sec
src/pattern.ts:549
↓ 1 callersMethodhandleStepping
* Handle stepping (e.g. * / 14) * * @param conf Current part, expected to be a string like * /20 (without the space) * @param type One of "se
src/pattern.ts:658
↓ 1 callersMethodincrement
* Increment to next run time * * @param pattern The pattern used to increment the current date. * @param options Cron options used for increm
src/date.ts:715
↓ 1 callersFunctionisCronCallback
(v: unknown)
src/utils.ts:21
↓ 1 callersMethodisNthWeekdayOfMonth
* Check if the given date is the nth occurrence of a weekday in its month. * * @param year The year. * @param month The month (0 for January,
src/date.ts:227
↓ 1 callersMethodisStopped
* Indicates whether or not the cron job is permanently stopped * * @returns Running or not
src/croner.ts:451
↓ 1 callersFunctioniso
(dates: Date[])
test/interval-dst.test.ts:9
↓ 1 callersFunctioniso
(dates: Date[])
test/dst-croner-rust.test.ts:27
↓ 1 callersFunctioniso
(dates: Date[])
test/fixed-time-rule.test.ts:11
↓ 1 callersFunctionlocal
(d: Date)
test/dst-croner-rust.test.ts:51
↓ 1 callersFunctionnoWildcard
(pattern: string)
test/fixed-time-rule.test.ts:18
↓ 1 callersFunctionoffsetAt
(ms: number)
src/helpers/timezone.ts:180
↓ 1 callersFunctionparseISOLocal
* Helper function that takes an ISO8601 local date time string and creates a TimePoint. * Throws on failure. Throws on invalid date or time. * * @p
src/helpers/timezone.ts:64
↓ 1 callersMethodpartToArray
* Convert current part (seconds/minutes etc) to an array of 1 or 0 depending on if the part is about to trigger a run or not.
src/pattern.ts:333
↓ 1 callersMethodpause
* Pause execution * * @returns Wether pause was successful
src/croner.ts:523
↓ 1 callersMethodpeek
* Returns the next scheduled date without advancing the cursor. * * @returns The next scheduled date, or null if the schedule is exhausted.
src/croner.ts:1011
↓ 1 callersMethodpreviousRun
* Return previous run start time * * @returns Previous run time
src/croner.ts:478
↓ 1 callersMethodrecurse
* Increment to next run time recursively. * * This function traverses the date components (year, month, day, hour, minute, second) * to find
src/date.ts:582
↓ 1 callersMethodrecurseBackward
* Find previous match by recursively checking pattern parts in reverse. * * This is the backward equivalent of the recurse() method. It searches
src/date.ts:795
↓ 1 callersMethodrecurseBackwardStep
* One step of recurseBackward(). Returns the level to continue at, or the result. * * @private
src/date.ts:816
next →1–100 of 140, ranked by callers