diff options
Diffstat (limited to 'calendar/cal-util')
-rw-r--r-- | calendar/cal-util/cal-recur.c | 10 | ||||
-rw-r--r-- | calendar/cal-util/timeutil.c | 31 | ||||
-rw-r--r-- | calendar/cal-util/timeutil.h | 1 |
3 files changed, 5 insertions, 37 deletions
diff --git a/calendar/cal-util/cal-recur.c b/calendar/cal-util/cal-recur.c index 164ffdbfc6..2fad53ca63 100644 --- a/calendar/cal-util/cal-recur.c +++ b/calendar/cal-util/cal-recur.c @@ -483,7 +483,7 @@ cal_recur_generate_instances (CalComponent *comp, goto out; } - dtstart_time = time_from_icaltimetype (*dtstart.value); + dtstart_time = icaltime_as_timet (*dtstart.value); cal_component_get_rrule_list (comp, &rrules); cal_component_get_rdate_list (comp, &rdates); @@ -497,7 +497,7 @@ cal_recur_generate_instances (CalComponent *comp, time_t dtend_time; if (dtend.value) - dtend_time = time_from_icaltimetype (*dtend.value); + dtend_time = icaltime_as_timet (*dtend.value); else dtend_time = time_day_end (dtstart_time); @@ -640,7 +640,7 @@ cal_recur_from_icalrecurrencetype (struct icalrecurrencetype *ir) /* FIXME: we don't deal with ir->count. Also, how does libical * distinguish between n-occurrences and until-some-date rules? */ - r->enddate = time_from_icaltimetype (ir->until); + r->enddate = icaltime_as_timet (ir->until); switch (ir->week_start) { case ICAL_MONDAY_WEEKDAY: @@ -787,7 +787,7 @@ generate_instances_for_year (CalComponent *comp, /* FIXME: this only deals with the start time */ period = elem->data; - t = time_from_icaltimetype (period->start); + t = icaltime_as_timet (period->start); cal_object_time_from_time (&cotime, t); g_array_append_val (occs, cotime); @@ -818,7 +818,7 @@ generate_instances_for_year (CalComponent *comp, /* FIXME: this only deals with the start time */ period = elem->data; - t = time_from_icaltimetype (period->start); + t = icaltime_as_timet (period->start); cal_object_time_from_time (&cotime, t); g_array_append_val (ex_occs, cotime); diff --git a/calendar/cal-util/timeutil.c b/calendar/cal-util/timeutil.c index bbce9b82d6..1281e6fe92 100644 --- a/calendar/cal-util/timeutil.c +++ b/calendar/cal-util/timeutil.c @@ -12,37 +12,6 @@ -/** - * time_from_icaltimetype: - * @itt: A struct icaltimetype value. - * - * Converts a struct icaltimetype value into a time_t value. Does not deal with - * timezones. - * - * Return value: A time_t value. - **/ -time_t -time_from_icaltimetype (struct icaltimetype itt) -{ - struct tm tm; - - /* FIXME: this does not handle timezones */ - - memset (&tm, 0, sizeof (tm)); - - tm.tm_year = itt.year - 1900; - tm.tm_mon = itt.month - 1; - tm.tm_mday = itt.day; - - if (!itt.is_date) { - tm.tm_hour = itt.hour; - tm.tm_min = itt.minute; - tm.tm_sec = itt.second; - } - - return mktime (&tm); -} - #define digit_at(x,y) (x [y] - '0') time_t diff --git a/calendar/cal-util/timeutil.h b/calendar/cal-util/timeutil.h index 37b70ee6cf..b8fa6400d2 100644 --- a/calendar/cal-util/timeutil.h +++ b/calendar/cal-util/timeutil.h @@ -14,7 +14,6 @@ #include <icaltypes.h> -time_t time_from_icaltimetype (struct icaltimetype itt); time_t time_from_isodate (char *str); time_t time_from_start_duration (time_t start, char *duration); char *isodate_from_time_t (time_t t); |