revert formating date

This commit is contained in:
Milos Kozak 2017-01-07 23:26:28 +01:00
parent f3f6a911ae
commit 38f397cd59
3 changed files with 8 additions and 4 deletions

View file

@ -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);

View file

@ -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) {

View file

@ -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) {