aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/calobj.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/calobj.c')
-rw-r--r--calendar/calobj.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/calendar/calobj.c b/calendar/calobj.c
index 47d8c8a97e..624a179b05 100644
--- a/calendar/calobj.c
+++ b/calendar/calobj.c
@@ -1102,3 +1102,21 @@ ical_object_compute_end (iCalObject *ico)
ico->recur->_enddate = 0;
ical_object_generate_events (ico, ico->dtstart, 0, duration_callback, &count);
}
+
+int
+alarm_compute_offset (CalendarAlarm *a)
+{
+ if (!a->enabled)
+ return -1;
+ switch (a->units){
+ case ALARM_MINUTES:
+ a->offset = a->count * 60;
+ break;
+ case ALARM_HOURS:
+ a->offset = a->count * 3600;
+ break;
+ case ALARM_DAYS:
+ a->offset = a->count * 24 * 3600;
+ }
+ return a->offset;
+}