Fix the correct method.

This commit is contained in:
Johannes Mockenhaupt 2018-03-24 20:13:50 +01:00
parent 5a6af7f6d5
commit 8a2d49b833
No known key found for this signature in database
GPG key ID: 9E1EA6AF7BBBB0D1

View file

@ -289,7 +289,7 @@ public class NSUpload {
data.put("timeshift", profileSwitch.timeshift); data.put("timeshift", profileSwitch.timeshift);
data.put("percentage", profileSwitch.percentage); data.put("percentage", profileSwitch.percentage);
} }
data.put("created_at", getNextAvailableSecond(profileSwitch.date)); data.put("created_at", DateUtil.toISOString(profileSwitch.date));
data.put("enteredBy", MainApp.instance().getString(R.string.app_name)); data.put("enteredBy", MainApp.instance().getString(R.string.app_name));
uploadCareportalEntryToNS(data); uploadCareportalEntryToNS(data);
} catch (JSONException e) { } catch (JSONException e) {
@ -337,7 +337,7 @@ public class NSUpload {
if (data.has("notes")) prebolus.put("notes", data.get("notes")); if (data.has("notes")) prebolus.put("notes", data.get("notes"));
long mills = DateUtil.fromISODateString(data.getString("created_at")).getTime(); long mills = DateUtil.fromISODateString(data.getString("created_at")).getTime();
Date preBolusDate = new Date(mills + data.getInt("preBolus") * 60000L + 1000L); Date preBolusDate = new Date(mills + data.getInt("preBolus") * 60000L + 1000L);
prebolus.put("created_at", DateUtil.toISOString(preBolusDate.getTime())); prebolus.put("created_at", getNextAvailableSecond(preBolusDate.getTime()));
uploadCareportalEntryToNS(prebolus); uploadCareportalEntryToNS(prebolus);
} }
Context context = MainApp.instance().getApplicationContext(); Context context = MainApp.instance().getApplicationContext();