Liking cljdoc? Tell your friends :D

clj-cron-parse.core


bound-seq?clj

(bound-seq? minimum maximum xs)
source

dow-num-or-rangeclj

(dow-num-or-range s)
source

int-or-nilclj

(int-or-nil s)
source

last-dow-of-monthclj

(last-dow-of-month now ls)
source

make-cron-mapclj

(make-cron-map cron)
source

month-num-or-rangeclj

(month-num-or-range s)
source

next-dateclj

(next-date now cron)
(next-date now cron timezone)

takes an org.joda.time.DateTime representing now and a cron expression and returns the next org.joda.time.DateTime to occur for that cron exp. If it is not possible to parse the cron expression then nil is returned.

If you provide the value of now as a DateTime in a timezone, it will return the cron calculated within that timezone. To view the value in UTC simply convert it to the UTC timezone.

Alternatively you can provide a timezone id such as "Asia/Seoul" (defaults to "UTC") as the final argument and you will get back the next date in UTC time for the cron expression calculated in that timezone. For example, you want the next UTC date for every day at midday in Seoul (next-date now "0 0 12 * * *" "Asia/Seoul").

The cron expressions attempt to follow BSD crontab by Paul Vixie with the addition of seconds in the first position and W can be used for both day of month and day of week.

   field         allowed values
   -----         --------------
   second        0-59
   minute        0-59
   hour          0-23
   day of month  1-31 L W
   month         1-12 (or names, see below)
   day of week   0-7 (0 or 7 is Sun, or use names) W 1L 2L 3L 4L 5L 6L 7L

A field may be an asterisk (*), which always stands for ``first-last''.

Ranges of numbers are allowed. Ranges are two numbers separated with a hyphen. The specified range is inclusive. For example, 8-11 for an ``hours'' entry specifies execution at hours 8, 9, 10 and 11.

Lists are allowed. A list is a set of numbers (or ranges) separated by commas. Examples: 1,2,5,9'',0-4,8-12''.

Step values can be used in conjunction with ranges. Following a range with /<number>'' specifies skips of the number's value through the range. For example,0-23/2'' can be used in the hours field to specify command execution every other hour (the alternative in the V7 standard is 0,2,4,6,8,10,12,14,16,18,20,22''). Steps are also permitted after an asterisk, so if you want to sayevery two hours'', just use ``*/2''.

Names can also be used for the month'' andday of week'' fields. Use the first three letters of the particular day or month (case does not matter).

Note: The day of a command's execution can be specified by two fields -- day of month, and day of week. If both fields are restricted (ie, are not *), the earliest time will be returned. For example, ``30 4 1,15 * 5'' would return the next date matching 4:30 am on the 1st and 15th of each month, plus every Friday.

Instead of the first five fields, one of eight special strings may appear:

   string          meaning
   ------          -------
   @yearly         Run once a year, "0 0 0 1 1 *".
   @annually       (same as @yearly)
   @monthly        Run once a month, "0 0 0 1 * *".
   @weekly         Run once a week, "0 0 0 * * 0".
   @daily          Run once a day, "0 0 0 * * *".
   @midnight       (same as @daily)
   @hourly         Run once an hour, "0 0 * * * *".
takes an org.joda.time.DateTime representing now and a cron expression and returns the next org.joda.time.DateTime to occur for that cron exp.
If it is not possible to parse the cron expression then nil is returned.

If you provide the value of now as a DateTime in a timezone, it will return the cron calculated within that timezone.
To view the value in UTC simply convert it to the UTC timezone.

Alternatively you can provide a timezone id such as "Asia/Seoul" (defaults to "UTC") as the final argument and you
will get back the next date in UTC time for the cron expression calculated in that timezone.  For example, you want the next UTC
date for every day at midday in Seoul (next-date now "0 0 12 * * *" "Asia/Seoul").

The cron expressions attempt to follow BSD crontab by Paul Vixie with the addition of seconds in the first position and W can be used for both
day of month and day of week.

       field         allowed values
       -----         --------------
       second        0-59
       minute        0-59
       hour          0-23
       day of month  1-31 L W
       month         1-12 (or names, see below)
       day of week   0-7 (0 or 7 is Sun, or use names) W 1L 2L 3L 4L 5L 6L 7L

 A field may be an asterisk (*), which always stands for ``first-last''.

 Ranges of numbers are allowed.  Ranges are two numbers separated with a hyphen.  The specified range is inclusive.  For example, 8-11 for an ``hours'' entry specifies execution
 at hours 8, 9, 10 and 11.

 Lists are allowed.  A list is a set of numbers (or ranges) separated by commas.  Examples: ``1,2,5,9'', ``0-4,8-12''.

 Step values can be used in conjunction with ranges.  Following a range with ``/<number>'' specifies skips of the number's value through the range.  For example, ``0-23/2'' can be
 used in the hours field to specify command execution every other hour (the alternative in the V7 standard is ``0,2,4,6,8,10,12,14,16,18,20,22'').  Steps are also permitted after
 an asterisk, so if you want to say ``every two hours'', just use ``*/2''.

 Names can also be used for the ``month'' and ``day of week'' fields.  Use the first three letters of the particular day or month (case does not matter).

 Note: The day of a command's execution can be specified by two fields -- day of month, and day of week.
 If both fields are restricted (ie, are not *), the earliest time will be returned.
 For example, ``30 4 1,15 * 5'' would return the next date matching 4:30 am on the 1st and 15th of each month, plus every Friday.

 Instead of the first five fields, one of eight special strings may appear:

       string          meaning
       ------          -------
       @yearly         Run once a year, "0 0 0 1 1 *".
       @annually       (same as @yearly)
       @monthly        Run once a month, "0 0 0 1 * *".
       @weekly         Run once a week, "0 0 0 * * 0".
       @daily          Run once a day, "0 0 0 * * *".
       @midnight       (same as @daily)
       @hourly         Run once an hour, "0 0 * * * *".
       
sourceraw docstring

next-date-by-domclj

(next-date-by-dom now {:keys [sec minute hour dom month]})
source

next-date-by-dowclj

(next-date-by-dow now {:keys [sec minute hour dow month] :as e})
source

next-divisibleclj

(next-divisible x d)
source

next-valclj

(next-val now as)
source

next-week-domclj

(next-week-dom now)
source

now-with-domsclj

(now-with-doms now dom)
source

now-with-dowsclj

(now-with-dows now dow)
source

now-with-hoursclj

(now-with-hours now hour)
source

now-with-minutesclj

(now-with-minutes now minute)
source

now-with-monthsclj

(now-with-months now month)
source

now-with-secondsclj

(now-with-seconds now sec)
source

num-or-rangeclj

(num-or-range s)
source

parse-domclj

(parse-dom s)
source

parse-dowclj

(parse-dow s)
source

parse-dow-itemclj

(parse-dow-item s)
source

parse-fieldclj

(parse-field minimum maximum range-fn s)
source

parse-itemclj

(parse-item s range-fn)
source

parse-single-dayclj

(parse-single-day s)
source

parse-single-monthclj

(parse-single-month s)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close