Notifications des dons dans les deux semaines prochaines semaines

This commit is contained in:
Schoumi 2015-04-16 18:36:24 +02:00
parent c524297eaa
commit e453036e67

View file

@ -160,6 +160,7 @@ public class AlarmReceiver extends BroadcastReceiver {
cal.set(Calendar.MILLISECOND, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.DAY_OF_YEAR,cal.get(Calendar.DAY_OF_YEAR)+14);
List<BloodSite> sites = Database.getInstance(context).getBloodSites(-1);
checkForProximity(sites, context);
checkForDate(sites, context);
@ -167,6 +168,7 @@ public class AlarmReceiver extends BroadcastReceiver {
List<Long> newNotifications = new ArrayList<Long>();
for(BloodSite site : sites)
{
if(site.getDate().compareTo(cal) < 0)
newNotifications.add(site.getDbId());
}