MCPcopy Create free account

hub / github.com/Hexagon/croner / functions

Functions185 in github.com/Hexagon/croner

↓ 38 callersMethodgetTime
* Convert current state back to a javascript Date() and return UTC milliseconds
src/date.ts:1125
↓ 31 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:321
↓ 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:310
↓ 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:513
↓ 11 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:337
↓ 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:140
↓ 10 callersMethodparse
* Parse current pattern, will throw on any type of failure * @private
src/pattern.ts:120
↓ 9 callersMethodmsToNext
* Returns number of milliseconds to next run * * @param prev Starting date, defaults to now - minimum interval
src/croner.ts:501
↓ 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 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:391
↓ 8 callersMethodschedule
* Schedule a new job * * @param func - Function to be run each iteration of pattern
src/croner.ts:559
↓ 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:408
↓ 6 callersFunctiontoTZ
(d: Date, tzStr?: string)
src/helpers/timezone.ts:298
↓ 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:178
↓ 5 callersMethod_toMs
* The exact instant of a reference date. Strings are read in the timezone of the job.
src/croner.ts:811
↓ 5 callersFunctiontextList
(items: string[], lang: CronDescribeLanguage)
src/describe.ts:233
↓ 4 callersMethod_offsetMs
* The dayOffset option in milliseconds
src/croner.ts:159
↓ 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:353
↓ 4 callersMethodextractNth
(conf: string, type: string)
src/pattern.ts:606
↓ 4 callersFunctionfromTZ
(tp: TimePoint, throwOnInvalid?: boolean)
src/helpers/timezone.ts:173
↓ 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:455
↓ 4 callersMethodnext
* Returns the next scheduled date and advances the cursor. * Implements the ECMAScript Iterator protocol. * * @returns `{ value: Date, done:
src/croner.ts:1006
↓ 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:428
↓ 4 callersFunctionsetValues
Indices of the set values of a field, plus offset
src/describe.ts:204
↓ 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:677
↓ 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:826
↓ 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:151
↓ 3 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:446
↓ 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:420
↓ 3 callersFunctionnumberList
Number list, with ranges for three or more consecutive values: "1-5, 7, and 9"
src/describe.ts:240
↓ 3 callersFunctionresolveLocal
(tp: TimePoint)
src/helpers/timezone.ts:199
↓ 3 callersMethodrunsLeft
* Returns number of runs left, undefined = unlimited
src/croner.ts:668
↓ 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:484
↓ 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:497
↓ 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:514
↓ 3 callersFunctionwildcardStep
* The step of values that are exactly what `*` with a step gives, such as 0, 15, 30 and 45 for * minutes (*\/15), or 0 if they are not. Two values ar
src/describe.ts:220
↓ 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:366
↓ 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:563
↓ 2 callersMethod_shift
* Move a run time back by dayOffset, to the pattern match it was shifted from
src/croner.ts:209
↓ 2 callersMethod_trigger
* Internal function to trigger a run, used by both scheduled and manual trigger
src/croner.ts:617
↓ 2 callersMethodcurrentRun
* Return current/previous run start time * * @returns Current (if running) or previous run time
src/croner.ts:483
↓ 2 callersMethoddescribe
* Describe the pattern in words, such as "At 12:00, on Monday, Tuesday, Wednesday, Thursday, * and Friday." for "0 12 * * MON-FRI". * Returns un
src/croner.ts:436
↓ 2 callersFunctionfindOffsetChange
(fromMs: number, toMs: number, tz?: string)
src/helpers/timezone.ts:258
↓ 2 callersMethodfromDate
* Sets internals using a Date
src/date.ts:261
↓ 2 callersFunctionfromTZISO
(localTimeStr: string, tz?: string, throwOnInvalid?: boolean)
src/helpers/timezone.ts:160
↓ 2 callersFunctionhasUtcDesignator
(dtStr: string)
src/helpers/timezone.ts:50
↓ 2 callersMethodinPhrase
"in January"
src/describe.ts:46
↓ 2 callersMethodisBusy
* Indicates whether or not the cron job is currently working * * @returns Running or not
src/croner.ts:474
↓ 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 callersMethodrangeEnd
* With alternativeWeekdays, a day-of-week range whose end is before its start wraps around the * week, as in Quartz and croner-rust: SAT-SUN (7-1)
src/pattern.ts:549
↓ 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:1038
↓ 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:661
↓ 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:246
↓ 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:955
↓ 1 callersMethod_next
* Internal version of next. Cron needs millseconds internally, hence _next.
src/croner.ts:703
↓ 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:777
↓ 1 callersMethod_previousTarget
* Find the previous time the job ran, before a reference (default: now). See _nextTarget.
src/croner.ts:193
↓ 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:913
↓ 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:880
↓ 1 callersMethodatPhrase
"At minute 5"
src/describe.ts:42
↓ 1 callersMethodatTime
"At 14:00"
src/describe.ts:35
↓ 1 callersMethodatTimeAndEveryXSeconds
"At 14:00, every 10 seconds"
src/describe.ts:37
↓ 1 callersMethodatTimeAtSecond
"At 14:00, at second 10-20"
src/describe.ts:39
↓ 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:192
↓ 1 callersMethoddayPhrase
"day 1 and 15"
src/describe.ts:63
↓ 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 callersFunctiondescribe
( pattern: string, options: { domAndDow?: boolean; alternativeWeekdays?: boolean } = {}, language?: Cron
test/describe.test.ts:5
↓ 1 callersFunctiondescribeDay
( pattern: CronPattern, domAndDow: boolean, lang: CronDescribeLanguage, )
src/describe.ts:345
↓ 1 callersFunctiondescribeDayOfMonth
(pattern: CronPattern, lang: CronDescribeLanguage)
src/describe.ts:312
↓ 1 callersFunctiondescribeDayOfWeek
(pattern: CronPattern, lang: CronDescribeLanguage)
src/describe.ts:323
↓ 1 callersFunctiondescribeMonth
(pattern: CronPattern, lang: CronDescribeLanguage)
src/describe.ts:362
↓ 1 callersFunctiondescribePattern
( pattern: CronPattern, domAndDow: boolean, lang: CronDescribeLanguage = english, )
src/describe.ts:386
↓ 1 callersFunctiondescribeTime
(pattern: CronPattern, lang: CronDescribeLanguage)
src/describe.ts:256
↓ 1 callersFunctiondescribeYear
(pattern: CronPattern, lang: CronDescribeLanguage)
src/describe.ts:370
↓ 1 callersMethodeveryPastPhrase
"Every minute past hour 0", from "Every minute" and "hour 0"
src/describe.ts:57
↓ 1 callersMethodeveryXHours
"of every 2 hours"
src/describe.ts:26
↓ 1 callersMethodeveryXMinutes
"every 15 minutes"
src/describe.ts:22
↓ 1 callersMethodeveryXMonths
"every 2 months"
src/describe.ts:28
↓ 1 callersMethodeveryXSeconds
"every 10 seconds"
src/describe.ts:24
↓ 1 callersMethodeveryXYears
"every 2 years"
src/describe.ts:30
↓ 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:276
↓ 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:139
next →1–100 of 185, ranked by callers