- Fix RRULE BYDAY filtering for daily frequency events (Tether sync weekdays only) - Fix timezone transfer in recurring event expansion - Add comprehensive timezone-aware iCal generation - Add extensive test suite for recurrence and timezone functionality - Update dependencies and configuration examples - Implement cleanup logic for orphaned events - Add detailed import plan documentation This completes the core import functionality with proper timezone handling, RRULE parsing, and duplicate prevention mechanisms.
22 lines
816 B
Rust
22 lines
816 B
Rust
use chrono::{DateTime, Utc, NaiveDateTime};
|
|
|
|
fn main() {
|
|
let start = DateTime::from_naive_utc_and_offset(
|
|
NaiveDateTime::parse_from_str("20231225T083000", "%Y%m%dT%H%M%S").unwrap(),
|
|
Utc
|
|
);
|
|
let end = start + chrono::Duration::minutes(30);
|
|
|
|
let mut event = caldav_sync::event::Event::new("Tether Sync".to_string(), start, end);
|
|
event.timezone = Some("America/Toronto".to_string());
|
|
|
|
let ical = event.to_ical().unwrap();
|
|
println!("=== Event with Timezone (America/Toronto) ===");
|
|
println!("{}", ical);
|
|
println!("\n");
|
|
|
|
let utc_event = caldav_sync::event::Event::new("UTC Event".to_string(), start, end);
|
|
let ical_utc = utc_event.to_ical().unwrap();
|
|
println!("=== Event without Timezone (fallback to UTC) ===");
|
|
println!("{}", ical_utc);
|
|
}
|