From 835f007b675e06033daf55aa0b98b0cbb5ca675c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Sat, 11 Mar 2023 17:44:01 +0100 Subject: [PATCH] Make statistics filter start at 00:00 (#6371) --- .../de/danoeh/antennapod/storage/database/PodDBAdapter.java | 2 +- .../ui/statistics/subscriptions/StatisticsFilterDialog.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java b/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java index c870e35de..849110a22 100644 --- a/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java +++ b/storage/database/src/main/java/de/danoeh/antennapod/storage/database/PodDBAdapter.java @@ -1193,7 +1193,7 @@ public class PodDBAdapter { + TABLE_NAME_FEED_MEDIA + "." + KEY_POSITION + "> 0"; } final String timeFilter = lastPlayedTime + ">=" + timeFilterFrom - + " AND " + lastPlayedTime + "<=" + timeFilterTo; + + " AND " + lastPlayedTime + "<" + timeFilterTo; String playedTime = TABLE_NAME_FEED_MEDIA + "." + KEY_PLAYED_DURATION; if (includeMarkedAsPlayed) { playedTime = "(CASE WHEN " + playedTime + " != 0" diff --git a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/StatisticsFilterDialog.java b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/StatisticsFilterDialog.java index 8efdcf603..077883321 100644 --- a/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/StatisticsFilterDialog.java +++ b/ui/statistics/src/main/java/de/danoeh/antennapod/ui/statistics/subscriptions/StatisticsFilterDialog.java @@ -107,6 +107,10 @@ public class StatisticsFilterDialog { private Pair makeMonthlyList(long oldestDate, boolean inclusive) { Calendar date = Calendar.getInstance(); date.setTimeInMillis(oldestDate); + date.set(Calendar.HOUR_OF_DAY, 0); + date.set(Calendar.MINUTE, 0); + date.set(Calendar.SECOND, 0); + date.set(Calendar.MILLISECOND, 0); date.set(Calendar.DAY_OF_MONTH, 1); ArrayList names = new ArrayList<>(); ArrayList timestamps = new ArrayList<>();