cron-0.4.1.1: Cron datatypes and Attoparsec parser

Safe HaskellNone

System.Cron.Internal.Check

Synopsis

Documentation

nextMatch :: CronSchedule -> UTCTime -> Maybe UTCTimeSource

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.

getDOW :: Day -> IntSource

ISO8601 maps Sunday as 7 and Monday as 1, we want Sunday as 0

expand :: CronSchedule -> Maybe ExpandedSource

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

fillTo :: (Int, Int) -> Int -> [Int]Source

hasValidForMonthSource

Arguments

:: Int

Month

-> EField 
-> Bool 

data Expanded Source

Constructors

Expanded 

Fields

minF :: EField
 
hourF :: EField
 
domF :: EField
 
monthF :: EField
 
dowF :: EField
 

Instances

scheduleMatches :: CronSchedule -> UTCTime -> BoolSource

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