aboutsummaryrefslogtreecommitdiffstats
path: root/libical/src
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@helixcode.com>2000-11-07 02:39:55 +0800
committerFederico Mena Quintero <federico@src.gnome.org>2000-11-07 02:39:55 +0800
commit561fed0aa901f9a6286adaa4437cb5c44de86b84 (patch)
treed8ff13e877c163b6860b1439d14e288139da5af3 /libical/src
parent0981458bf8d699550bf4a6950300ba7a79a05845 (diff)
downloadgsoc2013-evolution-561fed0aa901f9a6286adaa4437cb5c44de86b84.tar
gsoc2013-evolution-561fed0aa901f9a6286adaa4437cb5c44de86b84.tar.gz
gsoc2013-evolution-561fed0aa901f9a6286adaa4437cb5c44de86b84.tar.bz2
gsoc2013-evolution-561fed0aa901f9a6286adaa4437cb5c44de86b84.tar.lz
gsoc2013-evolution-561fed0aa901f9a6286adaa4437cb5c44de86b84.tar.xz
gsoc2013-evolution-561fed0aa901f9a6286adaa4437cb5c44de86b84.tar.zst
gsoc2013-evolution-561fed0aa901f9a6286adaa4437cb5c44de86b84.zip
Handle both the position and weekday in the by_day field.
2000-11-06 Federico Mena Quintero <federico@helixcode.com> * src/libical/icalvalue.c (icalvalue_recur_as_ical_string): Handle both the position and weekday in the by_day field. svn path=/trunk/; revision=6416
Diffstat (limited to 'libical/src')
-rw-r--r--libical/src/libical/icalvalue.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libical/src/libical/icalvalue.c b/libical/src/libical/icalvalue.c
index db0e58efe8..7c988a4d16 100644
--- a/libical/src/libical/icalvalue.c
+++ b/libical/src/libical/icalvalue.c
@@ -663,11 +663,16 @@ char* icalvalue_recur_as_ical_string(icalvalue* value)
for(i=0; i< limit && array[i] != ICAL_RECURRENCE_ARRAY_MAX;
i++){
if (j == 3) { /* BYDAY */
+ short pos = icalrecurrencetype_day_position(array[i]);
short dow = icalrecurrencetype_day_day_of_week(array[i]);
char *daystr = icalenum_weekday_to_string(dow);
- /* HACK, does not correctly handle the integer value */
- icalmemory_append_string(&str,&str_p,&buf_sz,daystr);
+ if (pos == 0)
+ icalmemory_append_string(&str,&str_p,&buf_sz,daystr);
+ else {
+ sprintf(temp,"%d%s",pos,daystr);
+ icalmemory_append_string(&str,&str_p,&buf_sz,temp);
+ }
} else {
sprintf(temp,"%d",array[i]);
icalmemory_append_string(&str,&str_p,&buf_sz, temp);