45 releases

new 0.0.47 Apr 16, 2024
0.0.44 Mar 13, 2024
0.0.31 Dec 31, 2023
0.0.27 Nov 11, 2023
0.0.1 Nov 15, 2021

#241 in Date and time

Download history 7/week @ 2023-12-22 9/week @ 2023-12-29 1/week @ 2024-01-05 16/week @ 2024-01-19 80/week @ 2024-02-09 651/week @ 2024-02-16 336/week @ 2024-02-23 336/week @ 2024-03-01 206/week @ 2024-03-08 111/week @ 2024-03-15 2/week @ 2024-03-22 21/week @ 2024-03-29 144/week @ 2024-04-05

296 downloads per month

MIT/Apache

185KB
4.5K SLoC

oni-comb-crond-rs

A rust crate for CROND parser library.

Usage

Returns an iterator that retrieve the calculation of the corresponding date and time from a CROND format string.

let dt: DateTime<Utc> = Utc.with_ymd_and_hms(2021, 1, 1, 1, 1, 0).unwrap();

let itr: CronIntervalIterator<Utc, CronSpecification> = CronSchedule::new("0-59/30 0-23/2 * * *").unwrap().upcoming(dt);

let dt_vec: Vec<DateTime<Utc>> = itr.take(5).collect::<Vec<_>>();

// 2021-01-01T02:00:00Z
// 2021-01-01T02:30:00Z
// 2021-01-01T04:00:00Z
// 2021-01-01T04:30:00Z
// 2021-01-01T06:00:00Z

Dependencies

~3.5–5MB
~82K SLoC