summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorByteHamster <ByteHamster@users.noreply.github.com>2024-01-03 20:32:56 +0100
committerGitHub <noreply@github.com>2024-01-03 20:32:56 +0100
commitbf6721842220d7e89a0c3a451f5965e57feb9ca0 (patch)
treed7bda765b86567da47cb6e48900c2cab8d999427 /core/src
parentf476086114a56d214558f37b066849150a141390 (diff)
downloadAntennaPod-bf6721842220d7e89a0c3a451f5965e57feb9ca0.zip
Print duration as number of days only on Echo (#6842)
Reverts an accidental change to the queue time display
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/java/de/danoeh/antennapod/core/util/Converter.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java b/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java
index d9c4a5098..30464969b 100644
--- a/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java
+++ b/core/src/main/java/de/danoeh/antennapod/core/util/Converter.java
@@ -83,14 +83,16 @@ public final class Converter {
* Converts milliseconds to a localized string containing hours and minutes.
*/
public static String getDurationStringLocalized(Context context, long duration) {
- return getDurationStringLocalized(context.getResources(), duration);
+ return getDurationStringLocalized(context.getResources(), duration, false);
}
- public static String getDurationStringLocalized(Resources resources, long duration) {
+ public static String getDurationStringLocalized(Resources resources, long duration, boolean includeDays) {
String result = "";
int h = (int) (duration / HOURS_MIL);
int d = h / 24;
- if (d > 0) {
+ if (!includeDays) {
+ d = 0;
+ } else if (d > 0) {
String days = resources.getQuantityString(R.plurals.time_days_quantified, d, d);
result += days.replace(" ", "\u00A0") + " ";
h -= d * 24;