1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
//! # eventix
//!
//! A high-level calendar and recurrence library for Rust with timezone-aware scheduling,
//! exceptions, and ICS import/export capabilities.
//!
//! ## Features
//!
//! - **Timezone-aware events**: All date/time fields use `chrono` with `chrono-tz` for proper timezone handling
//! - **Recurrence rules**: Support for all seven RFC 5545 frequencies (secondly, minutely, hourly, daily, weekly, monthly, yearly)
//! - **Exceptions**: Skip specific dates or apply custom filters (e.g., skip weekends)
//! - **ICS support**: Import and export events using the iCalendar format (RFC 5545 compliant with TZID support)
//! - **Builder API**: Ergonomic, fluent interface for creating events and calendars
//! - **Calendar view iterators**: Lazy day/week traversal for UI-friendly calendar rendering
//! - **Gap validation**: Find gaps between events, detect conflicts, and analyze schedule density
//! - **Schedule analysis**: Unique features for occupancy metrics, availability finding, and conflict resolution
//!
//! ## Quick Start
//!
//! ```rust
//! use eventix::{Calendar, Event, Recurrence};
//!
//! let mut cal = Calendar::new("My Calendar");
//!
//! let event = Event::builder()
//! .title("Weekly Team Meeting")
//! .description("Discuss project progress")
//! .start("2025-11-01 10:00:00", "America/New_York")
//! .duration_hours(1)
//! .recurrence(Recurrence::weekly().count(10))
//! .build()
//! .expect("Failed to build event");
//!
//! cal.add_event(event);
//! ```
//!
//! ## Timezone-Aware ICS Export
//!
//! Events are exported with proper timezone information for compatibility with calendar applications:
//!
//! ```rust
//! use eventix::{Calendar, Event};
//!
//! let mut cal = Calendar::new("Work Schedule");
//!
//! // Non-UTC timezones include TZID parameter
//! let event = Event::builder()
//! .title("Team Meeting")
//! .start("2025-10-27 10:00:00", "America/New_York")
//! .duration_hours(1)
//! .build()
//! .unwrap();
//!
//! cal.add_event(event);
//! cal.export_to_ics("schedule.ics").unwrap();
//!
//! // Generates: DTSTART;TZID=America/New_York:20251027T100000
//! // Compatible with Google Calendar, Outlook, and Apple Calendar
//! ```
//!
//! ## Schedule Analysis (Unique Feature)
//!
//! Find gaps, detect conflicts, and analyze schedule density:
//!
//! ```rust
//! use eventix::{Calendar, Event, gap_validation, timezone, Duration};
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let mut cal = Calendar::new("Work Schedule");
//!
//! // Add some events...
//! let event1 = Event::builder()
//! .title("Morning Meeting")
//! .start("2025-11-03 09:00:00", "America/New_York")
//! .duration_hours(1)
//! .build()?;
//!
//! let event2 = Event::builder()
//! .title("Afternoon Call")
//! .start("2025-11-03 14:00:00", "America/New_York")
//! .duration_hours(1)
//! .build()?;
//!
//! cal.add_event(event1);
//! cal.add_event(event2);
//!
//! // Find gaps in schedule
//! let tz = timezone::parse_timezone("America/New_York")?;
//! let start = timezone::parse_datetime_with_tz("2025-11-03 08:00:00", tz)?;
//! let end = timezone::parse_datetime_with_tz("2025-11-03 18:00:00", tz)?;
//!
//! let gaps = gap_validation::find_gaps(&cal, start, end, Duration::minutes(30))?;
//! println!("Found {} gaps of at least 30 minutes", gaps.len());
//!
//! // Calculate schedule density
//! let density = gap_validation::calculate_density(&cal, start, end)?;
//! println!("Schedule occupancy: {:.1}%", density.occupancy_percentage);
//! # Ok(())
//! # }
//! ```
//!
//! ## Modules
//!
//! - [`calendar`] - Calendar container for managing collections of events
//! - [`event`] - Event types and builder API
//! - [`gap_validation`] - Schedule analysis, gap detection, and conflict resolution (unique feature)
//! - [`ics`] - ICS (iCalendar) import/export with TZID support
//! - [`recurrence`] - Recurrence patterns (secondly, minutely, hourly, daily, weekly, monthly, yearly)
//! - [`timezone`] - Timezone utilities with DST awareness
//! - [`views`] - Lazy day/week calendar view iterators
//!
//! ## Examples
//!
//! See the `examples/` directory for more comprehensive examples:
//! - `basic.rs` - Simple calendar creation and event management
//! - `calendar_views.rs` - Lazy day and week view iteration for UI rendering
//! - `recurrence.rs` - All seven RFC 5545 recurrence frequencies with lazy iteration and DST handling
//! - `ics_export.rs` - ICS import/export functionality
//! - `timezone_ics_export.rs` - Timezone-aware ICS export demonstration
//! - `gap_validation.rs` - Schedule analysis and gap detection features
pub use Calendar;
pub use ;
pub use ;
pub use ;
pub use ;
// Re-export commonly used types from chrono
pub use ;
pub use Tz;