improve relative poll timestamp string format (#1939)

This commit is contained in:
Konrad Pozniak 2020-10-02 17:11:48 +02:00 committed by GitHub
commit 26a051220b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 230 additions and 312 deletions

View file

@ -964,8 +964,7 @@ public abstract class StatusBaseViewHolder extends RecyclerView.ViewHolder {
if (statusDisplayOptions.useAbsoluteTime()) {
pollDurationInfo = context.getString(R.string.poll_info_time_absolute, getAbsoluteTime(poll.getExpiresAt()));
} else {
String pollDuration = TimestampUtils.formatPollDuration(pollDescription.getContext(), poll.getExpiresAt().getTime(), timestamp);
pollDurationInfo = context.getString(R.string.poll_info_time_relative, pollDuration);
pollDurationInfo = TimestampUtils.formatPollDuration(pollDescription.getContext(), poll.getExpiresAt().getTime(), timestamp);
}
}

View file

@ -285,8 +285,7 @@ class StatusViewHelper(private val itemView: View) {
if (useAbsoluteTime) {
context.getString(R.string.poll_info_time_absolute, getAbsoluteTime(poll.expiresAt))
} else {
val pollDuration = TimestampUtils.formatPollDuration(context, poll.expiresAt!!.time, timestamp)
context.getString(R.string.poll_info_time_relative, pollDuration)
TimestampUtils.formatPollDuration(context, poll.expiresAt!!.time, timestamp)
}
}