Fix Echo using wrong number of days in a year (#6822)
This commit is contained in:
parent
b066c6e23c
commit
d39ddaa113
|
@ -209,7 +209,11 @@ public class EchoActivity extends AppCompatActivity {
|
||||||
viewBinding.largeLabel.setText(String.format(getEchoLanguage(), "%d", queueSecondsLeft / 3600));
|
viewBinding.largeLabel.setText(String.format(getEchoLanguage(), "%d", queueSecondsLeft / 3600));
|
||||||
viewBinding.belowLabel.setText(getResources().getQuantityString(
|
viewBinding.belowLabel.setText(getResources().getQuantityString(
|
||||||
R.plurals.echo_queue_hours_waiting, queueNumEpisodes, queueNumEpisodes));
|
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;
|
long secondsPerDay = queueSecondsLeft / daysUntilNextYear;
|
||||||
String timePerDay = Converter.getDurationStringLocalized(
|
String timePerDay = Converter.getDurationStringLocalized(
|
||||||
getLocalizedResources(this, getEchoLanguage()), secondsPerDay * 1000);
|
getLocalizedResources(this, getEchoLanguage()), secondsPerDay * 1000);
|
||||||
|
|
Loading…
Reference in New Issue