From 5ec2787ecf5a6a911dee882e66f1dac85a231a82 Mon Sep 17 00:00:00 2001
From: Lennart K <18233294+lennart-k@users.noreply.github.com>
Date: Tue, 13 Jan 2026 12:41:03 +0100
Subject: [PATCH] build MVP for birthday calendar
---
Cargo.lock | 2 +-
crates/ical/src/address_object.rs | 130 ++++++++++++++++--
.../addressbook_store/birthday_calendar.rs | 75 ++++++----
.../store_sqlite/src/addressbook_store/mod.rs | 8 +-
crates/store_sqlite/src/calendar_store.rs | 15 +-
5 files changed, 172 insertions(+), 58 deletions(-)
diff --git a/Cargo.lock b/Cargo.lock
index 4f6ad18..faf1b2e 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1771,7 +1771,7 @@ dependencies = [
[[package]]
name = "ical"
version = "0.11.0"
-source = "git+https://github.com/lennart-k/ical-rs?branch=dev#28e982f928a73f5af13f1e59e28da419567bf93f"
+source = "git+https://github.com/lennart-k/ical-rs?branch=dev#626982a02647c3bee5c7d0828facd1b77df5722f"
dependencies = [
"chrono",
"chrono-tz",
diff --git a/crates/ical/src/address_object.rs b/crates/ical/src/address_object.rs
index 52c9db8..1cac936 100644
--- a/crates/ical/src/address_object.rs
+++ b/crates/ical/src/address_object.rs
@@ -1,7 +1,20 @@
use crate::{CalendarObject, Error};
+use chrono::{NaiveDate, Utc};
+use ical::component::{
+ CalendarInnerDataBuilder, IcalAlarmBuilder, IcalCalendarObjectBuilder, IcalEventBuilder,
+};
use ical::generator::Emitter;
use ical::parser::vcard::{self, component::VcardContact};
+use ical::parser::{
+ Calscale, ComponentMut, IcalCALSCALEProperty, IcalDTENDProperty, IcalDTSTAMPProperty,
+ IcalDTSTARTProperty, IcalPRODIDProperty, IcalRRULEProperty, IcalSUMMARYProperty,
+ IcalUIDProperty, IcalVERSIONProperty, IcalVersion, VcardANNIVERSARYProperty, VcardBDAYProperty,
+ VcardFNProperty,
+};
+use ical::property::ContentLine;
+use ical::types::{CalDate, PartialDate};
use sha2::{Digest, Sha256};
+use std::str::FromStr;
use std::{collections::HashMap, io::BufReader};
#[derive(Debug, Clone)]
@@ -36,24 +49,115 @@ impl AddressObject {
&self.vcf
}
+ fn get_significant_date_object(
+ &self,
+ date: &PartialDate,
+ summary_prefix: &str,
+ suffix: &str,
+ ) -> Result