Complete frontend migration to shared VEvent model
- Update frontend to use shared calendar-models library - Add display methods to VEvent for UI compatibility - Remove duplicate VEvent definitions in frontend - Fix JSON field name mismatch (dtstart/dtend vs start/end) - Create CalendarEvent type alias for backward compatibility - Resolve "missing field start" parsing error 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -146,4 +146,38 @@ impl VEvent {
|
||||
pub fn is_exception(&self) -> bool {
|
||||
self.recurrence_id.is_some()
|
||||
}
|
||||
|
||||
/// Get display string for status
|
||||
pub fn get_status_display(&self) -> &'static str {
|
||||
match &self.status {
|
||||
Some(EventStatus::Tentative) => "Tentative",
|
||||
Some(EventStatus::Confirmed) => "Confirmed",
|
||||
Some(EventStatus::Cancelled) => "Cancelled",
|
||||
None => "Confirmed", // Default
|
||||
}
|
||||
}
|
||||
|
||||
/// Get display string for class
|
||||
pub fn get_class_display(&self) -> &'static str {
|
||||
match &self.class {
|
||||
Some(EventClass::Public) => "Public",
|
||||
Some(EventClass::Private) => "Private",
|
||||
Some(EventClass::Confidential) => "Confidential",
|
||||
None => "Public", // Default
|
||||
}
|
||||
}
|
||||
|
||||
/// Get display string for priority
|
||||
pub fn get_priority_display(&self) -> String {
|
||||
match self.priority {
|
||||
None => "Not set".to_string(),
|
||||
Some(0) => "Undefined".to_string(),
|
||||
Some(1) => "High".to_string(),
|
||||
Some(p) if p <= 4 => "High".to_string(),
|
||||
Some(5) => "Medium".to_string(),
|
||||
Some(p) if p <= 8 => "Low".to_string(),
|
||||
Some(9) => "Low".to_string(),
|
||||
Some(p) => format!("Priority {}", p),
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user