diff --git a/ical/Event.cpp b/ical/Event.cpp index 308bf83..71694b1 100644 --- a/ical/Event.cpp +++ b/ical/Event.cpp @@ -7,8 +7,9 @@ namespace ical { } void Event::parse(icalcomponent* event_component) { + uid = icalcomponent_get_uid(event_component); dtstart = icalcomponent_get_dtstart(event_component); - dtend = icalcomponent_get_dtstart(event_component); + dtend = icalcomponent_get_dtend(event_component); summary = std::string(icalcomponent_get_summary(event_component)); parse_alarms(event_component); } @@ -25,6 +26,7 @@ namespace ical { std::string Event::print() const { std::string s = ""; + s += "UID: " + uid + "\n"; s += "DTSTART: " + std::string(icaltime_as_ical_string(dtstart)) + "\n"; s += "DTEND: " + std::string(icaltime_as_ical_string(dtend)) + "\n"; s += "SUMMARY: " + summary + "\n"; diff --git a/ical/Event.h b/ical/Event.h index 99f3349..5659883 100644 --- a/ical/Event.h +++ b/ical/Event.h @@ -16,8 +16,11 @@ namespace ical { void parse(icalcomponent* event); void parse_alarms(icalcomponent* event_component); + std::string + std::string print() const; private: + std::string uid; std::string summary; icaltimetype dtstart; icaltimetype dtend;