MCPcopy
hub / github.com/node-cron/node-cron / createContext

Method createContext

src/tasks/inline-scheduled-task.ts:224–237  ·  view source on GitHub ↗
(executionDate: Date, execution?: Execution, reason?: SkipReason)

Source from the content-addressed store, hash-verified

222 }
223
224 private createContext(executionDate: Date, execution?: Execution, reason?: SkipReason): TaskContext{
225 const localTime = new LocalizedTime(executionDate, this.timezone)
226 const ctx: TaskContext = {
227 date: localTime.toDate(),
228 dateLocalIso: localTime.toISO(),
229 triggeredAt: new Date(),
230 task: this,
231 execution: execution
232 }
233
234 if (reason) ctx.reason = reason;
235
236 return ctx;
237 }
238}

Callers 4

constructorMethod · 0.95
startMethod · 0.95
stopMethod · 0.95
destroyMethod · 0.95

Calls 2

toDateMethod · 0.95
toISOMethod · 0.95

Tested by

no test coverage detected