From 0a244e884dd97dcc32318e5310750c5d09226520 Mon Sep 17 00:00:00 2001
From: tibbi <tibor@kaputa.sk>
Date: Mon, 12 Sep 2016 21:42:03 +0200
Subject: [PATCH] add yearly events

---
 .../com/simplemobiletools/calendar/DBHelper.java     | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/app/src/main/java/com/simplemobiletools/calendar/DBHelper.java b/app/src/main/java/com/simplemobiletools/calendar/DBHelper.java
index 3aef420ea..e84f94a8e 100644
--- a/app/src/main/java/com/simplemobiletools/calendar/DBHelper.java
+++ b/app/src/main/java/com/simplemobiletools/calendar/DBHelper.java
@@ -222,6 +222,18 @@ public class DBHelper extends SQLiteOpenHelper {
             newEvents.addAll(currEvents);
         }
 
+        // get yearly events
+        selection = COL_REPEAT_INTERVAL + " = " + Constants.YEAR + " AND " + COL_REPEAT_MONTH + " = " + dateTime.getMonthOfYear() + " AND " +
+                COL_REPEAT_DAY + " = " + dateTime.getDayOfMonth() + " AND " + COL_REPEAT_START + " <= " + dayEnd;
+        cursor = getEventsCursor(selection, null);
+        if (cursor != null) {
+            final List<Event> currEvents = fillEvents(cursor);
+            for (Event e : currEvents) {
+                updateEventTimes(e, ts);
+            }
+            newEvents.addAll(currEvents);
+        }
+
         return newEvents;
     }