+/// @todo We should replace this with a separate update function if there is some time left
+/**
+ * @brief Removes duplicated birthday events
+ *
+ * @param array $dates Array of possibly duplicated events
+ * @return array Cleaned events
+ */
+function event_remove_duplicates($dates) {
+ $dates2 = array();
+
+ foreach ($dates AS $date) {
+ if ($date['type'] == 'birthday') {
+ $dates2[$date['uid']."-".$date['cid']."-".$date['start']] = $date;
+ } else {
+ $dates2[] = $date;
+ }
+ }
+ return $dates2;
+}
+