Skip to content
This repository has been archived by the owner on Oct 24, 2022. It is now read-only.

Commit

Permalink
Fix locale not being applied to date display (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChargedByte committed Oct 10, 2022
1 parent c2632ed commit fb111cb
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,15 @@ public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
String possible = item.isDyslexiaPossible() ? array[0] : array[1];

holder.getTextViewDyslexia()
.setText(String.format(resources.getString(R.string.dyslexia_possible), possible));
.setText(String.format(resources.getString(R.string.dyslexia_possible), possible));

holder.getTextViewNameAndAge()
.setText(String.format("%s, %s", item.getStudentName(), String.format(resources.getString(R.string.age_message), item.getStudentAge())));

holder.getTextViewDateTime()
.setText(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM).format(item.getTimestamp()));
.setText(DateTimeFormatter.ofLocalizedDateTime(FormatStyle.MEDIUM)
.withLocale(holder.getContext().getResources().getConfiguration().getLocales().get(0))
.format(item.getTimestamp()));

holder.getTextViewScore()
.setText(String.format(resources.getString(R.string.score_message),
Expand Down

0 comments on commit fb111cb

Please sign in to comment.