Kaynağa Gözat

Added getCalendar to class LocalNotificationOptions

Sebastián Katzer 12 yıl önce
ebeveyn
işleme
0d039d2e44
1 değiştirilmiş dosya ile 14 ekleme ve 0 silme
  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.
      */