if (ps != NULL) {
t = icalproperty_get_dtstart(ps);
event_ts = icaltime_as_timet(t);
+
if (t.is_date) { //! calculate whether we are a day event.
Cal->start_hour = -1;
Cal->end_hour = -1;
Cal->end_day = -1;
- gmtime_r(&event_ts, &event);
+ localtime_r(&event_ts, &event);
event.tm_sec = 0;
event.tm_min = 0;
event.tm_hour = 0;
int fill_day_event = 0;
int show_event = 0;
time_t tt;
+ time_t dst_day;
char buf[256];
struct wcsession *WCC;
struct disp_cal *Cal;
month = today_tm.tm_mon + 1;
day = today_tm.tm_mday;
year = today_tm.tm_year + 1900;
-
+ dst_day = thetime - 3600;
for (i=0; i<(WCC->num_cal); ++i) {
fill_day_event = 0;
multi_day_event = 0;
Cal = &WCC->disp_cal[i];
all_day_event = Cal->start_hour == -1;
show_event = thetime == Cal->start_day;
- if (Cal->multi_day_event) {
+// lprintf(1,"Date: %d %d %d %d\n", thetime, Cal->start_day, day, thetime - Cal->start_day);
+ if (!all_day_event) {
// are we in the range of the event?
show_event = (Cal->start_day <= thetime) &&
(Cal->end_day >= thetime);
+ if (!show_event)
+ // are we in the range of the event?
+ show_event = (Cal->start_day <= dst_day) &&
+ (Cal->end_day >= dst_day);
// are we not start or end day?
fill_day_event = (Cal->start_day < thetime) &&
* First, back up to the 1st of the month...
*/
memset(&starting_tm, 0, sizeof(struct tm));
- if (WC->num_cal > 0)
- localtime_r(&WC->disp_cal[0].start_day, &starting_tm);
starting_tm.tm_year = year - 1900;
starting_tm.tm_mon = month - 1;