# Expressive Cron
> A fluent builder for cron expressions, inspired by Laravel.
[](https://crates.io/crates/expressive-cron)
[](https://crates.io/crates/expressive-cron)
[](https://docs.rs/expressive-cron)
## Features
- **Fluent Builder**: Chain frequency helpers (`daily`, `hourly_at`, `weekdays`, `every_five_minutes`, …) to build a cron expression without thinking about field positions.
- **Type-Safe Days**: Use the `DayOfWeek` enum instead of stringly-typed numerics — `cron.days(DayOfWeek::Monday)` instead of `cron.days("1")`.
- **Polymorphic Fields**: Methods accept any `impl IntoCronValue`, so `hourly_at(37)`, `hourly_at("*/10")`, and `hourly_at([15, 30, 45])` all work.
- **Filter Hooks**: Attach arbitrary closures with `when` / `skip`, or use built-in time-of-day windows via `between` / `unless_between`.
- **Timezone-Aware**: Time-based filters are evaluated in a configurable `chrono_tz::Tz`.
## Usage
```rust
use expressive_cron::{Cron, DayOfWeek};
let mut cron = Cron::new();
cron.every_five_minutes()
.between("09:00", "17:00")
.weekdays();
assert_eq!("*/5 * * * 1-5", cron.expression());
assert!(cron.filters_pass()); // true when called inside the window on a weekday
let mut nightly = Cron::new();
nightly.hourly_at([15, 30, 45]).days(DayOfWeek::Sunday);
assert_eq!("15,30,45 * * * 0", nightly.expression());
```
Please refer to the [documentation on docs.rs](https://docs.rs/expressive-cron) for detailed usage instructions.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.