aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libical/ChangeLog5
-rw-r--r--libical/src/libical/icalvalue.c9
2 files changed, 12 insertions, 2 deletions
diff --git a/libical/ChangeLog b/libical/ChangeLog
index 8b902fd4a9..b3fe27e703 100644
--- a/libical/ChangeLog
+++ b/libical/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
2000-10-20 Jesse Pavel <jpavel@helixcode.com>
* src/libical/icalproperty.c: added support for the
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);