fix bug in TimeListEdit

This commit is contained in:
Milos Kozak 2019-08-26 20:21:07 +02:00
parent 21ee334218
commit 775214676e
2 changed files with 7 additions and 6 deletions

View file

@ -164,18 +164,19 @@ public class Profile {
try { try {
final JSONObject o = array.getJSONObject(index); final JSONObject o = array.getJSONObject(index);
long tas = 0; long tas = 0;
// try { try {
// tas = getShitfTimeSecs((int) o.getLong("timeAsSeconds"));
// } catch (JSONException e) {
String time = o.getString("time"); String time = o.getString("time");
tas = getShitfTimeSecs(DateUtil.toSeconds(time)); tas = getShitfTimeSecs(DateUtil.toSeconds(time));
} catch (JSONException e) {
//log.debug(">>>>>>>>>>>> Used recalculated timeAsSecons: " + time + " " + tas); //log.debug(">>>>>>>>>>>> Used recalculated timeAsSecons: " + time + " " + tas);
// } tas = getShitfTimeSecs((int) o.getLong("timeAsSeconds"));
}
double value = o.getDouble("value") * multiplier; double value = o.getDouble("value") * multiplier;
sparse.put(tas, value); sparse.put(tas, value);
} catch (JSONException e) { } catch (Exception e) {
log.error("Unhandled exception", e); log.error("Unhandled exception", e);
log.error(json.toString()); log.error(json.toString());
FabricPrivacy.logException(e);
} }
} }

View file

@ -350,7 +350,7 @@ public class TimeListEdit {
data1.put(index, newObject1); data1.put(index, newObject1);
if (data2 != null) { if (data2 != null) {
JSONObject newObject2 = new JSONObject(); JSONObject newObject2 = new JSONObject();
newObject1.put("time", time); newObject2.put("time", time);
newObject2.put("timeAsSeconds", timeAsSeconds); newObject2.put("timeAsSeconds", timeAsSeconds);
newObject2.put("value", value2); newObject2.put("value", value2);
data2.put(index, newObject2); data2.put(index, newObject2);