+ /**
+ * Only show start/end times if we're actually looking at the VEVENT
+ * component. Otherwise it shows bogus dates for e.g. timezones
+ */
+ if (icalcomponent_isa(WC->disp_cal[i].cal) == ICAL_VEVENT_COMPONENT) {
+
+ q = icalcomponent_get_first_property(WC->disp_cal[i].cal,
+ ICAL_DTSTART_PROPERTY);
+ if (q != NULL) {
+ t = icalproperty_get_dtstart(q);
+
+ if (t.is_date) {
+ struct tm d_tm;
+ char d_str[32];
+ memset(&d_tm, 0, sizeof d_tm);
+ d_tm.tm_year = t.year - 1900;
+ d_tm.tm_mon = t.month - 1;
+ d_tm.tm_mday = t.day;
+ wc_strftime(d_str, sizeof d_str, "%x", &d_tm);
+ wprintf("<i>%s</i> %s<br>",
+ _("Date:"), d_str);
+ }
+ else {
+ tt = icaltime_as_timet(t);
+ fmt_date(buf, tt, 0);
+ wprintf("<i>%s</i> %s<br>",
+ _("Starting date/time:"), buf);
+ }
+ }
+
+ q = icalcomponent_get_first_property(WC->disp_cal[i].cal,
+ ICAL_DTEND_PROPERTY);
+ if (q != NULL) {
+ t = icalproperty_get_dtend(q);
+ tt = icaltime_as_timet(t);
+ fmt_date(buf, tt, 0);
+ wprintf("<i>%s</i> %s<br>",
+ _("Ending date/time:"), buf);
+ }
+ }
+