aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/calendar.c
diff options
context:
space:
mode:
authorArturo Espinosa <unammx@src.gnome.org>1998-04-03 12:53:51 +0800
committerArturo Espinosa <unammx@src.gnome.org>1998-04-03 12:53:51 +0800
commitdc90ad6b4302059c79a95d535c8363829faed7df (patch)
tree16d6a6f39048e3e01a8b63de62659230e3924a77 /calendar/calendar.c
parent01b4ff7532756f9202336e59d2f1e401e758fcf9 (diff)
downloadgsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.tar
gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.tar.gz
gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.tar.bz2
gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.tar.lz
gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.tar.xz
gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.tar.zst
gsoc2013-evolution-dc90ad6b4302059c79a95d535c8363829faed7df.zip
More calendar work -mig
svn path=/trunk/; revision=98
Diffstat (limited to 'calendar/calendar.c')
-rw-r--r--calendar/calendar.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/calendar/calendar.c b/calendar/calendar.c
index 5d7cb1dd8a..482543b84b 100644
--- a/calendar/calendar.c
+++ b/calendar/calendar.c
@@ -87,6 +87,17 @@ calendar_destroy (Calendar *cal)
g_free (cal);
}
+char *
+ice (time_t t)
+{
+ static char buffer [100];
+ struct tm *tm;
+
+ tm = localtime (&t);
+ sprintf (buffer, "%d/%d/%d", tm->tm_mday, tm->tm_mon, tm->tm_year);
+ return buffer;
+}
+
static GList *
calendar_get_objects_in_range (GList *objects, time_t start, time_t end, GCompareFunc sort_func)
{
@@ -94,12 +105,13 @@ calendar_get_objects_in_range (GList *objects, time_t start, time_t end, GCompar
for (; objects; objects = objects->next){
iCalObject *object = objects->data;
-
- if ((start <= object->dtstart) && (end >= object->dtend))
+
+ if ((start <= object->dtstart) && (object->dtend <= end)){
if (sort_func)
new_events = g_list_insert_sorted (new_events, object, sort_func);
else
new_events = g_list_prepend (new_events, object);
+ }
}
return new_events;