From 854d600424712c6ca35946d042a15c8e1c05539a Mon Sep 17 00:00:00 2001 From: Erik Johansson Date: Wed, 20 Jun 2018 21:28:12 +0200 Subject: [PATCH] Don't keep date format in static variable It needs to be updated if the locale (language) is changed. --- .../com/health/openscale/gui/views/DateMeasurementView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android_app/app/src/main/java/com/health/openscale/gui/views/DateMeasurementView.java b/android_app/app/src/main/java/com/health/openscale/gui/views/DateMeasurementView.java index b807197f..c2ebc1fe 100644 --- a/android_app/app/src/main/java/com/health/openscale/gui/views/DateMeasurementView.java +++ b/android_app/app/src/main/java/com/health/openscale/gui/views/DateMeasurementView.java @@ -31,11 +31,12 @@ public class DateMeasurementView extends MeasurementView { // Don't change key value, it may be stored persistent in preferences public static final String KEY = "date"; - private static final DateFormat dateFormat = DateFormat.getDateInstance(); + private final DateFormat dateFormat; private Date date; public DateMeasurementView(Context context) { super(context, R.string.label_date, R.drawable.ic_lastmonth); + dateFormat = DateFormat.getDateInstance(); } @Override