Show rule absolute time in list

pull/214/head
M66B 6 months ago
parent 5137772fa0
commit 6d8824c7ca

@ -164,9 +164,17 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> {
conditions.add(new Condition(context.getString(R.string.title_rule_body),
jcondition.getJSONObject("body").optString("value"),
jcondition.getJSONObject("body").optBoolean("regex")));
if (jcondition.has("date"))
if (jcondition.has("date")) {
String range = null;
JSONObject jdate = jcondition.optJSONObject("date");
if (jdate != null && jdate.has("after") && jdate.has("before")) {
long after = jdate.getLong("after");
long before = jdate.getLong("before");
range = DF.format(after) + " - " + DF.format(before);
}
conditions.add(new Condition(context.getString(R.string.title_rule_time_abs),
null, null));
range, null));
}
if (jcondition.has("schedule")) {
String range = null;
JSONObject jschedule = jcondition.optJSONObject("schedule");

Loading…
Cancel
Save