aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/cal-util
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-10-30 20:59:28 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-10-30 20:59:28 +0800
commit6cc1ca709616dafc050dc29e10f26686ac3e4caa (patch)
treee593984309d8f2ff05b729fd0fc1fb789b473ee3 /calendar/cal-util
parent6d9d0b02aab0c899742a43002116bc0caf05324f (diff)
downloadgsoc2013-evolution-6cc1ca709616dafc050dc29e10f26686ac3e4caa.tar
gsoc2013-evolution-6cc1ca709616dafc050dc29e10f26686ac3e4caa.tar.gz
gsoc2013-evolution-6cc1ca709616dafc050dc29e10f26686ac3e4caa.tar.bz2
gsoc2013-evolution-6cc1ca709616dafc050dc29e10f26686ac3e4caa.tar.lz
gsoc2013-evolution-6cc1ca709616dafc050dc29e10f26686ac3e4caa.tar.xz
gsoc2013-evolution-6cc1ca709616dafc050dc29e10f26686ac3e4caa.tar.zst
gsoc2013-evolution-6cc1ca709616dafc050dc29e10f26686ac3e4caa.zip
updated code to handle DATE values.
2001-10-30 Damon Chaplin <damon@ximian.com> * gui/dialogs/schedule-page.c: * gui/dialogs/event-page.c: * gui/dialogs/comp-editor-util.c: updated code to handle DATE values. * gui/gnome-cal.c (gnome_calendar_new_appointment_for): * gui/e-day-view.c (e_day_view_key_press): updated DATE code. * gui/e-cell-date-edit-text.c: * gui/calendar-model.c: updated to support DATE values. * cal-util/cal-recur.c (cal_recur_generate_instances_of_rule): updated to use DATE values in same way as Outlook - i.e. the DTEND date is not included entirely. Though I did make it so that if the DTSTART and DTEND used the same DATE value, it includes the entire day. So 1-day events should be the same. Long All-Day events will be 1 day shorter. * cal-util/cal-component.c (cal_component_get_start_plus_duration): don't subtract a day from the end date. * gui/tasks-control.c: updated the EPixmap paths for Cut/Copy etc. Removed Print & Print Preview paths, since we don't have menu commands for these any more. svn path=/trunk/; revision=14456
Diffstat (limited to 'calendar/cal-util')
-rw-r--r--calendar/cal-util/cal-component.c5
-rw-r--r--calendar/cal-util/cal-recur.c29
2 files changed, 26 insertions, 8 deletions
diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c
index 6e652b4851..5fc5addf19 100644
--- a/calendar/cal-util/cal-component.c
+++ b/calendar/cal-util/cal-component.c
@@ -2078,15 +2078,12 @@ cal_component_get_start_plus_duration (CalComponent *comp,
/* If DTSTART is a DATE value, then we need to check if the DURATION
includes any hours, minutes or seconds. If it does, we need to
- make the DTEND/DUE a DATE-TIME value. If not, we need to subtract
- one from the days, since the end date will be inclusive. */
+ make the DTEND/DUE a DATE-TIME value. */
duration.days += duration.weeks * 7;
if (dt->value->is_date) {
if (duration.hours != 0 || duration.minutes != 0
|| duration.seconds != 0) {
dt->value->is_date = 0;
- } else {
- duration.days--;
}
}
diff --git a/calendar/cal-util/cal-recur.c b/calendar/cal-util/cal-recur.c
index d17c626274..cfccdaf19f 100644
--- a/calendar/cal-util/cal-recur.c
+++ b/calendar/cal-util/cal-recur.c
@@ -707,18 +707,38 @@ cal_recur_generate_instances_of_rule (CalComponent *comp,
if (start == -1)
start = dtstart_time;
- /* If there is no DTEND, then use the same as the DTSTART. For
- DATE-TIME values that means we will just have a single point in
- time. For DATE values it means we end up with the entire day. */
- if (!dtend.value)
+ if (dtend.value) {
+ /* If both DTSTART and DTEND are DATE values, and they are the
+ same day, we add 1 day to DTEND. This means that most
+ events created with the old Evolution behavior will still
+ work OK. I'm not sure what Outlook does in this case. */
+ if (dtstart.value->is_date && dtend.value->is_date) {
+ if (icaltime_compare_date_only (*dtstart.value,
+ *dtend.value) == 0) {
+ icaltime_adjust (dtend.value, 1, 0, 0, 0);
+ }
+ }
+ } else {
+ /* If there is no DTEND, then if DTSTART is a DATE-TIME value
+ we use the same time (so we have a single point in time).
+ If DTSTART is a DATE value we add 1 day. */
+ dtend.value = g_new (struct icaltimetype, 1);
*dtend.value = *dtstart.value;
+ if (dtstart.value->is_date) {
+ icaltime_adjust (dtend.value, 1, 0, 0, 0);
+ }
+ }
+
if (dtend.tzid && !dtend.value->is_date) {
end_zone = (*tz_cb) (dtend.tzid, tz_cb_data);
} else {
end_zone = default_timezone;
}
+ /* We don't do this any more, since Outlook assumes that the DTEND
+ date is not included. */
+#if 0
/* If DTEND is a DATE value, we add 1 day to it so that it includes
the entire day. */
if (dtend.value->is_date) {
@@ -727,6 +747,7 @@ cal_recur_generate_instances_of_rule (CalComponent *comp,
dtend.value->second = 0;
icaltime_adjust (dtend.value, 1, 0, 0, 0);
}
+#endif
dtend_time = icaltime_as_timet_with_zone (*dtend.value, end_zone);
/* If there is no recurrence, just call the callback if the event