Commit 4510d61b by Sebastián Katzer

More readable intervall settings.

parent d1e0d942
...@@ -15,6 +15,7 @@ import java.util.Date; ...@@ -15,6 +15,7 @@ import java.util.Date;
import org.apache.cordova.CordovaInterface; import org.apache.cordova.CordovaInterface;
import org.json.JSONObject; import org.json.JSONObject;
import android.app.AlarmManager;
import android.media.RingtoneManager; import android.media.RingtoneManager;
import android.net.Uri; import android.net.Uri;
...@@ -42,13 +43,13 @@ public class LocalNotificationOptions { ...@@ -42,13 +43,13 @@ public class LocalNotificationOptions {
id = options.optString("id"); id = options.optString("id");
if (repeat.equalsIgnoreCase("daily")) { if (repeat.equalsIgnoreCase("daily")) {
interval = 86400000; interval = AlarmManager.INTERVAL_DAY;
} else if (repeat.equalsIgnoreCase("weekly")) { } else if (repeat.equalsIgnoreCase("weekly")) {
interval = 604800000; interval = AlarmManager.INTERVAL_DAY*7;
} else if (repeat.equalsIgnoreCase("monthly")) { } else if (repeat.equalsIgnoreCase("monthly")) {
interval = 2678400000L; // 31 days interval = AlarmManager.INTERVAL_DAY*31; // 31 days
} else if (repeat.equalsIgnoreCase("yearly")) { } else if (repeat.equalsIgnoreCase("yearly")) {
interval = 31536000000L; interval = AlarmManager.INTERVAL_DAY*365;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment