aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-cell-date-edit-text.c
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/gui/e-cell-date-edit-text.c
parent6d9d0b02aab0c899742a43002116bc0caf05324f (diff)
downloadgsoc2013-evolution-6cc1ca709616dafc050dc29e10f26686ac3e4caa.tar.gz
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/gui/e-cell-date-edit-text.c')
-rw-r--r--calendar/gui/e-cell-date-edit-text.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/calendar/gui/e-cell-date-edit-text.c b/calendar/gui/e-cell-date-edit-text.c
index 027db3b2a8..679e203d23 100644
--- a/calendar/gui/e-cell-date-edit-text.c
+++ b/calendar/gui/e-cell-date-edit-text.c
@@ -73,7 +73,6 @@ ecd_get_text (ECellText *cell, ETableModel *model, int col, int row)
{
ECellDateEditText *ecd = E_CELL_DATE_EDIT_TEXT (cell);
ECellDateEditValue *dv = e_table_model_value_at (model, col, row);
- struct icaltimetype tt;
struct tm tmp_tm;
char buffer[64];
@@ -87,7 +86,7 @@ ecd_get_text (ECellText *cell, ETableModel *model, int col, int row)
tmp_tm = icaltimetype_to_tm_with_zone (&dv->tt, dv->zone, ecd->zone);
e_time_format_date_and_time (&tmp_tm, ecd->use_24_hour_format,
- TRUE, FALSE,
+ !dv->tt.is_date, FALSE,
buffer, sizeof (buffer));
return g_strdup (buffer);
}
@@ -142,13 +141,22 @@ ecd_set_value (ECellText *cell, ETableModel *model, int col, int row,
ETimeParseStatus status;
struct tm tmp_tm;
ECellDateEditValue *value;
+ gboolean is_date = TRUE;
- status = e_time_parse_date_and_time (text, &tmp_tm);
-
+ /* Try to parse just a date first. If the value is only a date, we
+ use a DATE value. */
+ status = e_time_parse_date (text, &tmp_tm);
if (status == E_TIME_PARSE_INVALID) {
- show_date_warning (ecd);
- return;
- } else if (status == E_TIME_PARSE_NONE) {
+ is_date = FALSE;
+ status = e_time_parse_date_and_time (text, &tmp_tm);
+
+ if (status == E_TIME_PARSE_INVALID) {
+ show_date_warning (ecd);
+ return;
+ }
+ }
+
+ if (status == E_TIME_PARSE_NONE) {
value = NULL;
} else {
ECellDateEditValue dv;
@@ -161,10 +169,15 @@ ecd_set_value (ECellText *cell, ETableModel *model, int col, int row,
dv.tt.hour = tmp_tm.tm_hour;
dv.tt.minute = tmp_tm.tm_min;
dv.tt.second = tmp_tm.tm_sec;
+ dv.tt.is_date = is_date;
/* FIXME: We assume it is being set to the current timezone.
Is that OK? */
- dv.zone = ecd->zone;
+ if (is_date) {
+ dv.zone = NULL;
+ } else {
+ dv.zone = ecd->zone;
+ }
value = &dv;
}