fix bug in TimeListEdit
This commit is contained in:
parent
21ee334218
commit
775214676e
|
@ -164,18 +164,19 @@ public class Profile {
|
|||
try {
|
||||
final JSONObject o = array.getJSONObject(index);
|
||||
long tas = 0;
|
||||
// try {
|
||||
// tas = getShitfTimeSecs((int) o.getLong("timeAsSeconds"));
|
||||
// } catch (JSONException e) {
|
||||
try {
|
||||
String time = o.getString("time");
|
||||
tas = getShitfTimeSecs(DateUtil.toSeconds(time));
|
||||
} catch (JSONException e) {
|
||||
//log.debug(">>>>>>>>>>>> Used recalculated timeAsSecons: " + time + " " + tas);
|
||||
// }
|
||||
tas = getShitfTimeSecs((int) o.getLong("timeAsSeconds"));
|
||||
}
|
||||
double value = o.getDouble("value") * multiplier;
|
||||
sparse.put(tas, value);
|
||||
} catch (JSONException e) {
|
||||
} catch (Exception e) {
|
||||
log.error("Unhandled exception", e);
|
||||
log.error(json.toString());
|
||||
FabricPrivacy.logException(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -350,7 +350,7 @@ public class TimeListEdit {
|
|||
data1.put(index, newObject1);
|
||||
if (data2 != null) {
|
||||
JSONObject newObject2 = new JSONObject();
|
||||
newObject1.put("time", time);
|
||||
newObject2.put("time", time);
|
||||
newObject2.put("timeAsSeconds", timeAsSeconds);
|
||||
newObject2.put("value", value2);
|
||||
data2.put(index, newObject2);
|
||||
|
|
Loading…
Reference in a new issue