diff --git a/server/src/email_extract.rs b/server/src/email_extract.rs index c3f8f07..890be24 100644 --- a/server/src/email_extract.rs +++ b/server/src/email_extract.rs @@ -2157,28 +2157,28 @@ mod tests { let meta = extract_calendar_metadata_from_mail(&parsed, &body); // Assert detection as Google Calendar assert!(meta.is_google_calendar_event); - // Debug: print the rendered HTML for inspection let html = meta.body_html.expect("body_html"); + + // Print event date info for debugging + for part in parsed.subparts.iter() { + if part.ctype.mimetype == TEXT_CALENDAR { + if let Ok(ical) = part.get_body() { + println!("ICAL data: {}", ical); + if let Some(start) = ical.lines().find(|l| l.starts_with("DTSTART:")) { + println!("Start date: {}", start); + } + } + } + } println!("Rendered HTML: {}", html); - // Check that the calendar table highlights Thursday, not Friday - // Look for a table header row with days of week (allow whitespace) - let thursday_idx = html - .find(">\n Thu<") - .or_else(|| html.find(">Thu<")) - .expect("Should have a Thursday column"); - let friday_idx = html - .find(">\n Fri<") - .or_else(|| html.find(">Fri<")) - .expect("Should have a Friday column"); - // Find the first highlighted cell (background:#ffd700) - let highlight_idx = html - .find("background:#ffd700") - .expect("Should highlight a day"); - // The highlight should be closer to Thursday than Friday - assert!( - highlight_idx > thursday_idx && highlight_idx < friday_idx, - "Thursday should be highlighted, not Friday" - ); + + // Look for September 11 (Thursday) being highlighted + // The calendar should show Sept 11 highlighted with background:#ffd700 and the correct data-event-day + assert!(html.contains(r#"data-event-day="2025-09-11""#)); + assert!(html.contains(r#"background:#ffd700"#)); + + // Since 1:00 AM UTC on Friday 9/12 is 6:00 PM PDT on Thursday 9/11, verify times are correct + assert!(html.contains("6:00 PM Thu Sep 11, 2025")); } use super::*; #[test] diff --git a/server/templates/ical_summary.html b/server/templates/ical_summary.html index 856abfe..dc87a85 100644 --- a/server/templates/ical_summary.html +++ b/server/templates/ical_summary.html @@ -74,13 +74,7 @@ {% for week in all_days|batch(7) %} {% for day in week %} - {% if event_days.contains(day) && today.is_some() && today.unwrap() == day %} - - {{ day.day() }} - - {% elif event_days.contains(day) %} + {% if event_days.contains(day) %}