Eventix 📅
A high-level calendar and recurrence library for Rust with timezone-aware scheduling, exceptions, and ICS import/export.
Features
- 🌍 Timezone-aware events - Full support for timezones and DST handling using
chrono-tz - 🔄 Recurrence patterns - Daily, weekly, monthly, and yearly recurrence with advanced rules
- 🚫 Exception handling - Skip specific dates, weekends, or custom holiday lists
- 🚦 Booking workflow - Manage event status (
Confirmed,Tentative,Cancelled) with smart gap validation - 📅 ICS support - Import and export events using the iCalendar (
.ics) format - 🛠️ Builder API - Ergonomic, fluent interface for creating events and calendars
- 🔍 Gap validation - Find gaps between events, detect conflicts, analyze schedule density
- 📊 Schedule analysis - Occupancy metrics, conflict detection, availability finding
- ✅ Type-safe - Leverages Rust's type system for correctness
Why Eventix?
| Feature | eventix |
icalendar |
chrono |
|---|---|---|---|
| Primary Goal | Booking & Scheduling | File Parsing | Date/Time Math |
| Gap Finding | ✅ Native Support | ❌ Manual Logic | ❌ Manual Logic |
| Booking State | ✅ Confirmed/Cancelled | ❌ No Concept | ❌ No Concept |
| Timezone/DST | ✅ Built-in (chrono-tz) |
⚠️ Partial | ✅ Built-in |
| Recurrence | ✅ RRule + Exdates | ✅ RRule | ❌ None |
Quick Start
Add eventix to your Cargo.toml:
[]
= "0.3.1"
Basic Usage
use ;
Examples
Daily Recurrence with Exceptions
use ;
let tz = parse_timezone?;
let holiday = parse_datetime_with_tz?;
let event = builder
.title
.start
.duration
.recurrence
.skip_weekends
.exception_date // Skip Thanksgiving
.build?;
Weekly Recurrence
use ;
let event = builder
.title
.start
.duration
.recurrence
.build?;
Monthly Recurrence
use ;
let event = builder
.title
.start
.duration
.recurrence
.build?;
Booking Workflow
use ;
let mut event = builder
.title
.start
.duration
.status
.build?;
// Later, confirm the booking
event.confirm;
// Or cancel it (automatically ignored by gap validation)
event.cancel;
ICS Import/Export
use Calendar;
// Export with timezone awareness
let mut cal = new;
// ... add events ...
cal.export_to_ics?;
// Import
let imported_cal = import_from_ics?;
println!;
Timezone-Aware ICS Export:
Events are exported with proper timezone information for compatibility with calendar applications:
// Non-UTC timezones include TZID parameter
let event = builder
.title
.start
.duration
.build?;
// Generates: DTSTART;TZID=America/New_York:20251027T100000
// UTC events use standard Z suffix
let utc_event = builder
.title
.start
.duration
.build?;
// Generates: DTSTART:20251027T150000Z
This ensures events display at the correct local time in:
- Google Calendar
- Microsoft Outlook
- Apple Calendar
- Any RFC 5545 compliant calendar application
Query Events
use ;
let cal = new;
// ... add events ...
// Find events by title
let meetings = cal.find_events_by_title;
// Get events in a date range
let tz = parse_timezone?;
let start = parse_datetime_with_tz?;
let end = parse_datetime_with_tz?;
let november_events = cal.events_between?;
// Get events on a specific date
let date = parse_datetime_with_tz?;
let events = cal.events_on_date?;
Gap Detection & Schedule Analysis
Unique to Eventix - Features not found in other calendar crates:
use ;
let mut cal = new;
// ... add events ...
let tz = parse_timezone?;
let start = parse_datetime_with_tz?;
let end = parse_datetime_with_tz?;
// Find gaps between events (at least 30 minutes)
let gaps = find_gaps?;
for gap in gaps
// Detect scheduling conflicts
let overlaps = find_overlaps?;
if !overlaps.is_empty
// Analyze schedule density
let density = calculate_density?;
println!;
println!;
// Find available slots for a 1-hour meeting
let slots = find_available_slots?;
println!;
// Check if specific time is available
let check_time = parse_datetime_with_tz?;
let available = is_slot_available?;
// Get alternative times for conflicts
let alternatives = suggest_alternatives?;
Documentation
Run the examples:
# Basic calendar usage
# Recurrence patterns
# ICS import/export
# Gap validation and schedule analysis
View the full API documentation:
Architecture
The crate is organized into several modules:
calendar- Calendar container for managing eventsevent- Event types and builder APIrecurrence- Recurrence rules and patternsics- ICS format import/exporttimezone- Timezone handling and DST supportgap_validation- Schedule analysis, gap detection, conflict resolutionerror- Error types and results
Dependencies
chrono- Date and time handlingchrono-tz- Timezone databaserrule- Recurrence rule parsingicalendar- ICS format supportserde- Serialization support
Timezone Support
Eventix fully supports timezone-aware datetime handling with automatic DST transitions:
use timezone;
// Parse timezone
let tz = parse_timezone?;
// Parse datetime with timezone
let dt = parse_datetime_with_tz?;
// Convert between timezones
let tokyo_tz = parse_timezone?;
let dt_tokyo = convert_timezone;
// Check if datetime is in DST
let is_summer_time = is_dst;
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under either of:
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Acknowledgments
Built with these excellent crates:
chronoandchrono-tzfor date/time handlingrrulefor recurrence rule supporticalendarfor ICS format compatibility