diff options
author | ByteHamster <ByteHamster@users.noreply.github.com> | 2023-12-28 20:15:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-28 20:15:26 +0100 |
commit | d39ddaa113cf37a4b87304dc791172192d45b0e1 (patch) | |
tree | ba42a68d21db53b3a0413462d9f154be610bfda1 /ui/echo | |
parent | b066c6e23c335f79b624e90f15aaeb32f8a1cf81 (diff) | |
download | AntennaPod-d39ddaa113cf37a4b87304dc791172192d45b0e1.zip |
Fix Echo using wrong number of days in a year (#6822)
Diffstat (limited to 'ui/echo')
-rw-r--r-- | ui/echo/src/main/java/de/danoeh/antennapod/ui/echo/EchoActivity.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/echo/src/main/java/de/danoeh/antennapod/ui/echo/EchoActivity.java b/ui/echo/src/main/java/de/danoeh/antennapod/ui/echo/EchoActivity.java index 00b03a279..7bf3a75d0 100644 --- a/ui/echo/src/main/java/de/danoeh/antennapod/ui/echo/EchoActivity.java +++ b/ui/echo/src/main/java/de/danoeh/antennapod/ui/echo/EchoActivity.java @@ -209,7 +209,11 @@ public class EchoActivity extends AppCompatActivity { viewBinding.largeLabel.setText(String.format(getEchoLanguage(), "%d", queueSecondsLeft / 3600)); viewBinding.belowLabel.setText(getResources().getQuantityString( R.plurals.echo_queue_hours_waiting, queueNumEpisodes, queueNumEpisodes)); - int daysUntilNextYear = Math.max(356 - Calendar.getInstance().get(Calendar.DAY_OF_YEAR) + 1, 1); + Calendar dec31 = Calendar.getInstance(); + dec31.set(Calendar.DAY_OF_MONTH, 31); + dec31.set(Calendar.MONTH, Calendar.DECEMBER); + int daysUntilNextYear = Math.max(1, + dec31.get(Calendar.DAY_OF_YEAR) - Calendar.getInstance().get(Calendar.DAY_OF_YEAR) + 1); long secondsPerDay = queueSecondsLeft / daysUntilNextYear; String timePerDay = Converter.getDurationStringLocalized( getLocalizedResources(this, getEchoLanguage()), secondsPerDay * 1000); |