Explorar o código

Added getCalendar to class LocalNotificationOptions

Sebastián Katzer %!s(int64=12) %!d(string=hai) anos
pai
achega
0d039d2e44
Modificáronse 1 ficheiros con 14 adicións e 0 borrados
  1. 14 0
      src/android/LocalNotificationOptions.java

+ 14 - 0
src/android/LocalNotificationOptions.java

@@ -9,6 +9,9 @@
 
 package de.appplant.cordova.plugin;
 
+import java.util.Calendar;
+import java.util.Date;
+
 import org.json.JSONObject;
 
 import android.R;
@@ -50,6 +53,17 @@ public class LocalNotificationOptions {
         return date;
     }
 
+    /**
+     * Gibt die Zeit als Kalender an.
+     */
+    public Calendar getCalendar () {
+        Calendar calendar = Calendar.getInstance();
+
+        calendar.setTime(new Date(getDate()));
+
+        return calendar;
+    }
+
     /**
      * Gibt die Nachricht der Notification an.
      */