From 450c8beef81a4e7d23d0afc17c7ae5d1dba4e6ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Thu, 1 May 2008 23:31:04 +0000 Subject: [PATCH] * init time with NOW in our default timezone. --- webcit/calendar.c | 17 +++++++++++------ webcit/webcit.h | 1 + 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/webcit/calendar.c b/webcit/calendar.c index fadadf6c1..651a4126e 100644 --- a/webcit/calendar.c +++ b/webcit/calendar.c @@ -422,9 +422,10 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum, ch { icalcomponent *vtodo; icalproperty *p; - struct icaltimetype t; + struct icaltimetype IcalTime; time_t now; int created_new_vtodo = 0; + icalproperty_status todoStatus; now = time(NULL); @@ -505,9 +506,11 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum, ch wprintf(_("or")); wprintf(" "); if (p != NULL) { - t = icalproperty_get_dtstart(p); + IcalTime = icalproperty_get_dtstart(p); } - display_icaltimetype_as_webform(&t, "dtstart"); + else + IcalTime = icaltime_current_time_with_zone(get_default_icaltimezone()); + display_icaltimetype_as_webform(&IcalTime, "dtstart"); wprintf("\n"); wprintf(""); @@ -524,12 +527,14 @@ void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum, ch wprintf(_("or")); wprintf(" "); if (p != NULL) { - t = icalproperty_get_due(p); + IcalTime = icalproperty_get_due(p); } - display_icaltimetype_as_webform(&t, "due"); + else + IcalTime = icaltime_current_time_with_zone(get_default_icaltimezone()); + display_icaltimetype_as_webform(&IcalTime, "due"); wprintf("\n"); - icalproperty_status todoStatus = icalcomponent_get_status(vtodo); + todoStatus = icalcomponent_get_status(vtodo); wprintf("\n"); wprintf(_("Completed:")); wprintf(""); diff --git a/webcit/webcit.h b/webcit/webcit.h index 2f3e17c1b..c6b4d00ab 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -728,6 +728,7 @@ void display_edit_task(void); void save_task(void); void display_edit_event(void); void save_event(void); +icaltimezone *get_default_icaltimezone(void); void display_icaltimetype_as_webform(struct icaltimetype *, char *); void icaltime_from_webform(struct icaltimetype *result, char *prefix); void icaltime_from_webform_dateonly(struct icaltimetype *result, char *prefix); -- 2.39.2