aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-21 02:00:54 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-21 02:00:54 +0800
commit26e5915000652f4807e337a2b370ce0051972f04 (patch)
treee439a67248bf8c320c79774d6247fb5a3c37a05b /calendar/cal-util
parentefc1cef1db090cbce9b25260d7f236a21fc7e129 (diff)
downloadgsoc2013-evolution-26e5915000652f4807e337a2b370ce0051972f04.tar.gz
gsoc2013-evolution-26e5915000652f4807e337a2b370ce0051972f04.tar.zst
gsoc2013-evolution-26e5915000652f4807e337a2b370ce0051972f04.zip
A lot of usability changes to GnomeCal -miguel
svn path=/trunk/; revision=168
Diffstat (limited to 'calendar/cal-util')
-rw-r--r--calendar/cal-util/calobj.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/calendar/cal-util/calobj.c b/calendar/cal-util/calobj.c
index d9950e0bae..f298c2caf3 100644
--- a/calendar/cal-util/calobj.c
+++ b/calendar/cal-util/calobj.c
@@ -892,6 +892,23 @@ ical_foreach (GList *events, calendarfn fn, void *closure)
}
static int
+is_date_in_list (GList *list, struct tm *date)
+{
+ struct tm *tm;
+
+ for (; list; list = list->next){
+ time_t *timep = list->data;
+
+ tm = localtime (timep);
+ if (date->tm_mday == tm->tm_mday &&
+ date->tm_mon == tm->tm_mon &&
+ date->tm_year == tm->tm_year)
+ return 1;
+ }
+ return 0;
+}
+
+static int
generate (iCalObject *ico, time_t reference, calendarfn cb, void *closure)
{
struct tm dt_start, dt_end, ref;
@@ -910,7 +927,11 @@ generate (iCalObject *ico, time_t reference, calendarfn cb, void *closure)
dt_end.tm_year = ref.tm_year;
s_t = mktime (&dt_start);
+ if (ico->exdate && is_date_in_list (ico->exdate, &dt_start))
+ return;
+
e_t = mktime (&dt_end);
+
if (s_t == -1 || e_t == -1){
g_warning ("Produced invalid dates!\n");
return 0;
@@ -1093,7 +1114,7 @@ duration_callback (iCalObject *ico, time_t start, time_t end, void *closure)
(*count)++;
if (ico->recur->duration == *count) {
- ico->recur->enddate = end;
+ ico->recur->enddate = time_end_of_day (end);
return 0;
}
return 1;
@@ -1108,6 +1129,7 @@ ical_object_compute_end (iCalObject *ico)
g_return_if_fail (ico->recur != NULL);
ico->recur->_enddate = 0;
+ ico->recur->enddate = 0;
ical_object_generate_events (ico, ico->dtstart, 0, duration_callback, &count);
}