From 38f397cd592fc24cf989b5aab5f36f4b14f1bcd1 Mon Sep 17 00:00:00 2001 From: Milos Kozak Date: Sat, 7 Jan 2017 23:26:28 +0100 Subject: [PATCH] revert formating date --- .../plugins/DanaR/History/DanaRHistoryActivity.java | 2 +- .../plugins/DanaRKorean/DanaRKoreanFragment.java | 2 +- app/src/main/java/info/nightscout/utils/DateUtil.java | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/History/DanaRHistoryActivity.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/History/DanaRHistoryActivity.java index 902694e1b7..4056943e70 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/History/DanaRHistoryActivity.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaR/History/DanaRHistoryActivity.java @@ -308,7 +308,7 @@ public class DanaRHistoryActivity extends Activity { holder.dailybasal.setText(DecimalFormatter.to2Decimal(record.getRecordDailyBasal()) + "U"); holder.dailybolus.setText(DecimalFormatter.to2Decimal(record.getRecordDailyBolus()) + "U"); holder.dailytotal.setText(DecimalFormatter.to2Decimal(record.getRecordDailyBolus()+ record.getRecordDailyBasal()) + "U"); - holder.time.setText(DateUtil.timeString(record.getRecordDate())); + holder.time.setText(DateUtil.dateString(record.getRecordDate())); holder.time.setVisibility(View.VISIBLE); holder.value.setVisibility(View.GONE); holder.stringvalue.setVisibility(View.GONE); diff --git a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanFragment.java b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanFragment.java index a65fd9a30a..907718f636 100644 --- a/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanFragment.java +++ b/app/src/main/java/info/nightscout/androidaps/plugins/DanaRKorean/DanaRKoreanFragment.java @@ -196,7 +196,7 @@ public class DanaRKoreanFragment extends Fragment implements FragmentBase { if (DanaRKoreanPlugin.getDanaRPump().lastConnection.getTime() != 0) { Long agoMsec = new Date().getTime() - DanaRKoreanPlugin.getDanaRPump().lastConnection.getTime(); int agoMin = (int) (agoMsec / 60d / 1000d); - lastConnectionView.setText(DateUtil.dateString(DanaRKoreanPlugin.getDanaRPump().lastConnection) + " (" + String.format(MainApp.sResources.getString(R.string.minago), agoMin) + ")"); + lastConnectionView.setText(DateUtil.timeString(DanaRKoreanPlugin.getDanaRPump().lastConnection) + " (" + String.format(MainApp.sResources.getString(R.string.minago), agoMin) + ")"); SetWarnColor.setColor(lastConnectionView, agoMin, 16d, 31d); } // if (DanaRKoreanPlugin.getDanaRPump().lastBolusTime.getTime() != 0) { diff --git a/app/src/main/java/info/nightscout/utils/DateUtil.java b/app/src/main/java/info/nightscout/utils/DateUtil.java index 4ad75f7d06..c4efa45f93 100644 --- a/app/src/main/java/info/nightscout/utils/DateUtil.java +++ b/app/src/main/java/info/nightscout/utils/DateUtil.java @@ -86,11 +86,15 @@ public class DateUtil { } public static String dateString(Date date) { - return DateUtils.formatDateTime(MainApp.instance(), date.getTime(), DateUtils.FORMAT_SHOW_DATE); + //return DateUtils.formatDateTime(MainApp.instance(), date.getTime(), DateUtils.FORMAT_SHOW_DATE); this provide month name not number + DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT); + return df.format(date); } public static String dateString(long mills) { - return DateUtils.formatDateTime(MainApp.instance(), mills, DateUtils.FORMAT_SHOW_DATE); + //return DateUtils.formatDateTime(MainApp.instance(), mills, DateUtils.FORMAT_SHOW_DATE); this provide month name not number + DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT); + return df.format(mills); } public static String timeString(Date date) {