Safe Haskell | None |
---|---|

Language | Haskell2010 |

## Synopsis

- nextMatch :: CronSchedule -> UTCTime -> Maybe UTCTime
- nextMatches :: [Day] -> Expanded -> UTCTime -> [UTCTime]
- dowMatch :: UTCTime -> EField -> Bool
- getDOW :: Day -> Int
- validDays :: EField -> EField -> Day -> [Day]
- expand :: CronSchedule -> Maybe Expanded
- expandF :: (Int, Int) -> CronField -> Maybe EField
- expandBFStepped :: (Int, Int) -> BaseField -> Int -> Maybe EField
- fillTo :: (Int, Int) -> Int -> [Int]
- expandBF :: (Int, Int) -> BaseField -> Maybe EField
- validTODs :: EField -> EField -> [DiffTime]
- todToDiffTime :: Int -> Int -> DiffTime
- timeOfDay :: DiffTime -> (Int, Int)
- hasValidForMonth :: Int -> EField -> Bool
- data Expanded = Expanded {}
- type EField = NonEmpty Int
- scheduleMatches :: CronSchedule -> UTCTime -> Bool
- restricted :: CronField -> Bool
- isStar :: CronField -> Bool

# Documentation

nextMatch :: CronSchedule -> UTCTime -> Maybe UTCTime Source #

Will return the next time from the given starting point where this schedule will match. Returns Nothing if the schedule will never match. Note that this function is not inclusive of the given time: the result will always be at least 1 minute beyond the given time. This is usually used to implement absolute timestamp schedulers. If you need to see multiple matches ahead, just keep feeding the result into nextMatch. Note that because nextMatch only returns Nothing on a schedule that will *never* be matched, it is safe to assume that if a schedule returns a Just once, it will always return a Just.

expand :: CronSchedule -> Maybe Expanded Source #

Guarantees: the Expanded will be satisfiable (no invalid dates, no empties). dow 7 will be normalized to 0 (Sunday)

scheduleMatches :: CronSchedule -> UTCTime -> Bool Source #

Does the given cron schedule match for the given timestamp? This is usually used for implementing polling-type schedulers like cron itself.

restricted :: CronField -> Bool Source #