1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-25 17:27:00 +00:00

Show rule absolute time in list

This commit is contained in:
M66B 2024-01-29 10:57:56 +01:00
parent 5137772fa0
commit 6d8824c7ca

View file

@ -164,9 +164,17 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> {
conditions.add(new Condition(context.getString(R.string.title_rule_body), conditions.add(new Condition(context.getString(R.string.title_rule_body),
jcondition.getJSONObject("body").optString("value"), jcondition.getJSONObject("body").optString("value"),
jcondition.getJSONObject("body").optBoolean("regex"))); 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), conditions.add(new Condition(context.getString(R.string.title_rule_time_abs),
null, null)); range, null));
}
if (jcondition.has("schedule")) { if (jcondition.has("schedule")) {
String range = null; String range = null;
JSONObject jschedule = jcondition.optJSONObject("schedule"); JSONObject jschedule = jcondition.optJSONObject("schedule");