aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2002-02-07 07:30:49 +0800
committerDamon Chaplin <damon@src.gnome.org>2002-02-07 07:30:49 +0800
commit9112abc02f065a077aaf7b03a8d181bd74fe4b49 (patch)
tree88744c741fae1519ddfa701d1b3aca56c39e1bea /calendar/cal-util
parentd64e7cf12f73a73a0c5b99806fd695d428bea72f (diff)
downloadgsoc2013-evolution-9112abc02f065a077aaf7b03a8d181bd74fe4b49.tar
gsoc2013-evolution-9112abc02f065a077aaf7b03a8d181bd74fe4b49.tar.gz
gsoc2013-evolution-9112abc02f065a077aaf7b03a8d181bd74fe4b49.tar.bz2
gsoc2013-evolution-9112abc02f065a077aaf7b03a8d181bd74fe4b49.tar.lz
gsoc2013-evolution-9112abc02f065a077aaf7b03a8d181bd74fe4b49.tar.xz
gsoc2013-evolution-9112abc02f065a077aaf7b03a8d181bd74fe4b49.tar.zst
gsoc2013-evolution-9112abc02f065a077aaf7b03a8d181bd74fe4b49.zip
convert months from 1-12 to 0-11. Fixes bug #19235.
2002-02-06 Damon Chaplin <damon@ximian.com> * cal-util/cal-recur.c (cal_recur_from_icalproperty): convert months from 1-12 to 0-11. Fixes bug #19235. svn path=/trunk/; revision=15584
Diffstat (limited to 'calendar/cal-util')
-rw-r--r--calendar/cal-util/cal-recur.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/calendar/cal-util/cal-recur.c b/calendar/cal-util/cal-recur.c
index cfccdaf19f..e050004031 100644
--- a/calendar/cal-util/cal-recur.c
+++ b/calendar/cal-util/cal-recur.c
@@ -904,6 +904,7 @@ cal_recur_from_icalproperty (icalproperty *prop, gboolean exception,
struct icalrecurrencetype ir;
CalRecurrence *r;
gint max_elements, i;
+ GList *elem;
g_return_val_if_fail (prop != NULL, NULL);
@@ -956,6 +957,11 @@ cal_recur_from_icalproperty (icalproperty *prop, gboolean exception,
r->bymonth = array_to_list (ir.by_month,
sizeof (ir.by_month) / sizeof (ir.by_month[0]));
+ for (elem = r->bymonth; elem; elem = elem->next) {
+ /* We need to convert from 1-12 to 0-11, i.e. subtract 1. */
+ int month = GPOINTER_TO_INT (elem->data) - 1;
+ elem->data = GINT_TO_POINTER (month);
+ }
r->byweekno = array_to_list (ir.by_week_no,
sizeof (ir.by_week_no) / sizeof (ir.by_week_no[0]));