| Crates.io | holiday-rs |
| lib.rs | holiday-rs |
| version | 0.1.0 |
| created_at | 2025-08-20 05:00:03.603663+00 |
| updated_at | 2025-08-20 05:00:03.603663+00 |
| description | Lightweight holiday and business-day calculations (MVP: FR) |
| homepage | |
| repository | https://github.com/desirekataku/holiday-rs |
| max_upload_size | |
| id | 1802874 |
| size | 21,727 |
holiday-rs est une bibliothèque Rust légère pour le calcul des jours fériés et des jours ouvrables en France 🇫🇷.
use holiday_rs::{get_holidays, export, next_holiday};
use chrono::NaiveDate;
fn main() {
let year = 2025;
let holidays = get_holidays(year, "FR");
println!("Jours fériés en France pour l'année {}:", year);
for holiday in &holidays {
println!("- {}: {}", holiday.name, holiday.date);
}
println!("\nEn JSON:\n{}", export::to_pretty_json(&holidays));
println!("\nEn CSV:\n{}", export::to_csv_string(&holidays));
let today = NaiveDate::from_ymd_opt(2025, 5, 2).unwrap();
if let Some(next) = next_holiday(today, "FR") {
println!("Prochain jour férié après {}: {} le {}", today, next.name, next.date);
}
}