small fixes

This commit is contained in:
Lennart K
2026-01-07 11:58:02 +01:00
parent 896e934c0a
commit a9f3833a32
8 changed files with 23 additions and 5612 deletions

View File

@@ -4,7 +4,6 @@ use ical::parser::{
Component,
vcard::{self, component::VcardContact},
};
use ical::types::CalDateTime;
use sha2::{Digest, Sha256};
use std::{collections::HashMap, io::BufReader};
@@ -62,20 +61,6 @@ impl AddressObject {
&self.vcf
}
#[must_use]
pub fn get_anniversary(&self) -> Option<(CalDateTime, bool)> {
// let prop = self.vcard.get_property("ANNIVERSARY")?.value.as_deref()?;
// CalDateTime::parse_vcard(prop).ok()
todo!()
}
#[must_use]
pub fn get_birthday(&self) -> Option<(CalDateTime, bool)> {
todo!()
// let prop = self.vcard.get_property("BDAY")?.value.as_deref()?;
// CalDateTime::parse_vcard(prop).ok()
}
#[must_use]
pub fn get_full_name(&self) -> Option<&str> {
let prop = self.vcard.get_property("FN")?;

View File

@@ -1,6 +1,4 @@
use crate::Error;
use chrono::DateTime;
use chrono::Utc;
use derive_more::Display;
use ical::component::CalendarInnerData;
use ical::component::IcalCalendarObject;
@@ -115,22 +113,8 @@ impl CalendarObject {
&self.ics
}
#[must_use]
pub fn get_component_name(&self) -> &str {
self.get_object_type().as_str()
}
#[must_use]
pub fn get_object_type(&self) -> CalendarObjectType {
(&self.inner).into()
}
pub fn expand_recurrence(
&self,
start: Option<DateTime<Utc>>,
end: Option<DateTime<Utc>>,
) -> Result<String, Error> {
// Ok(self.inner.expand_recurrence(start, end)?)
todo!()
}
}

View File

@@ -2,9 +2,7 @@ use chrono::{DateTime, NaiveDateTime, Utc};
use derive_more::derive::Deref;
use rustical_xml::{ValueDeserialize, ValueSerialize};
const LOCAL_DATE_TIME: &str = "%Y%m%dT%H%M%S";
const UTC_DATE_TIME: &str = "%Y%m%dT%H%M%SZ";
pub const LOCAL_DATE: &str = "%Y%m%d";
#[derive(Debug, thiserror::Error, PartialEq, Eq)]
pub enum CalDateTimeError {