-/* TODO: temporary copy from libical, apply this patch to libical... */
-int webcit_icaltime_compare(const struct icaltimetype a_in, const struct icaltimetype b_in)
-{
- struct icaltimetype a, b;
-
- a = icaltime_convert_to_zone(a_in, icaltimezone_get_utc_timezone());
- b = icaltime_convert_to_zone(b_in, icaltimezone_get_utc_timezone());
-
- if (a.year > b.year)
- return 1;
- else if (a.year < b.year)
- return -1;
-
- else if (a.month > b.month)
- return 1;
- else if (a.month < b.month)
- return -1;
-
- else if (a.day > b.day)
- return 1;
- else if (a.day < b.day)
- return -1;
-
- /* if both are dates, we are done */
- if (a.is_date && b.is_date)
- return 0;
-
- /* else, if only one is a date (and we already know the date part is equal),
- then the other is greater */
- else if (b.is_date)
- return 1;
- else if (a.is_date)
- return -1;
-
- else if (a.hour > b.hour)
- return 1;
- else if (a.hour < b.hour)
- return -1;
-
- else if (a.minute > b.minute)
- return 1;
- else if (a.minute < b.minute)
- return -1;
-
- else if (a.second > b.second)
- return 1;
- else if (a.second < b.second)
- return -1;
-
- return 0;
-}
-
-