| Crates.io | chrono-kit |
| lib.rs | chrono-kit |
| version | 0.1.1 |
| created_at | 2025-08-17 02:12:25.028918+00 |
| updated_at | 2025-08-17 13:02:11.948382+00 |
| description | A time manipulation toolkit built on chrono |
| homepage | |
| repository | https://github.com/wangLiu-gh/chrono-kit |
| max_upload_size | |
| id | 1799049 |
| size | 33,610 |
A time manipulation toolkit built on chrono, providing convenient iterators and utilities for working with dates and times.
Currently implemented features:
NaiveDatetimeRangeIterator) with forward/reverse supportNaiveDatetimeIterator) with forward/reverse supportWant to see something added? Open an issue with your feature request!
Add to your Cargo.toml:
[dependencies]
chrono-kit = "0.1"
use chrono_kit::iter::NaiveDatetimeRangeIterator;
use chrono::{NaiveDateTime, Duration};
let start = NaiveDateTime::parse_from_str("2023-01-01 00:00:00", "%Y-%m-%d %H:%M:%S").unwrap();
let end = NaiveDateTime::parse_from_str("2023-01-03 00:00:00", "%Y-%m-%d %H:%M:%S").unwrap();
let step = Duration::hours(1);
let mut iter = NaiveDatetimeRangeIterator::new(start, end, step).unwrap();
for (range_start, range_end) in iter {
println!("Range: {} to {}", range_start, range_end);
}
// Reverse iteration example
let step = Duration::hours(-1); // Negative step for reverse iteration
let mut reverse_iter = NaiveDatetimeRangeIterator::new(start, end, step).unwrap();
for (range_start, range_end) in reverse_iter {
println!("Reverse range: {} to {}", range_start, range_end);
}
Dual-licensed under MIT or Apache 2.0 at your option.