matchesCron()
Test whether a date matches a parsed cron schedule.
Import
Section titled “Import”import { matchesCron } from "@graphrefly/ts/sources";Signature
Section titled “Signature”function matchesCron( schedule: CronSchedule, date: Date, opts: CronMatchOptions = {},): booleanParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
schedule | CronSchedule | Parsed cron schedule to match against. |
date | Date | Date to test. |
opts | CronMatchOptions | Optional timezone override. |
Returns
Section titled “Returns”true when the date satisfies all cron fields.
Example
Section titled “Example”matchesCron(parseCron("0 * * * *"), new Date());Source
Section titled “Source”packages/ts/src/graph/sources.ts