Absolute/relative time

pull/196/head
M66B 5 years ago
parent 33b49d8541
commit 1b42e8c677

@ -2068,7 +2068,8 @@ The following rule conditions are available:
* Subject contains * Subject contains
* Has attachments * Has attachments
* Header contains * Header contains
* Day/time between * Absolute time between (since version 1.1540)
* Relative time between
All the conditions of a rule need to be true for the rule action to be executed. All the conditions of a rule need to be true for the rule action to be executed.
All conditions are optional, but there needs to be at least one condition, to prevent matching all messages. All conditions are optional, but there needs to be at least one condition, to prevent matching all messages.

@ -128,8 +128,10 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> {
condition.add(context.getString(R.string.title_rule_subject)); condition.add(context.getString(R.string.title_rule_subject));
if (jcondition.has("header")) if (jcondition.has("header"))
condition.add(context.getString(R.string.title_rule_header)); condition.add(context.getString(R.string.title_rule_header));
if (jcondition.has("date"))
condition.add(context.getString(R.string.title_rule_time_abs));
if (jcondition.has("schedule")) if (jcondition.has("schedule"))
condition.add(context.getString(R.string.title_rule_time)); condition.add(context.getString(R.string.title_rule_time_rel));
tvCondition.setText(TextUtils.join(" & ", condition)); tvCondition.setText(TextUtils.join(" & ", condition));
} catch (Throwable ex) { } catch (Throwable ex) {
tvCondition.setText(ex.getMessage()); tvCondition.setText(ex.getMessage());

@ -332,7 +332,7 @@ public class FragmentRule extends FragmentBase {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString("title", getString(R.string.title_rule_date_after)); args.putString("title", getString(R.string.title_rule_time_after));
args.putBoolean("day", true); args.putBoolean("day", true);
Object time = tvDateAfter.getTag(); Object time = tvDateAfter.getTag();
@ -350,7 +350,7 @@ public class FragmentRule extends FragmentBase {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putString("title", getString(R.string.title_rule_date_before)); args.putString("title", getString(R.string.title_rule_time_before));
args.putBoolean("day", true); args.putBoolean("day", true);
Object time = tvDateBefore.getTag(); Object time = tvDateBefore.getTag();

@ -421,7 +421,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:singleLine="true"
android:text="@string/title_rule_date" android:text="@string/title_rule_time_abs"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
@ -503,7 +503,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:singleLine="true" android:singleLine="true"
android:text="@string/title_rule_time" android:text="@string/title_rule_time_rel"
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"

@ -1239,10 +1239,10 @@
<string name="title_rule_attachments">Has attachments</string> <string name="title_rule_attachments">Has attachments</string>
<string name="title_rule_mime_type" translatable="false">Mime type</string> <string name="title_rule_mime_type" translatable="false">Mime type</string>
<string name="title_rule_header">Header contains</string> <string name="title_rule_header">Header contains</string>
<string name="title_rule_date">Date range</string> <string name="title_rule_time_abs">Absolute time between </string>
<string name="title_rule_date_after">Date after</string> <string name="title_rule_time_after">After</string>
<string name="title_rule_date_before">Date before</string> <string name="title_rule_time_before">Before</string>
<string name="title_rule_time">Time between</string> <string name="title_rule_time_rel">Relative time between</string>
<string name="title_rule_regex">Regex</string> <string name="title_rule_regex">Regex</string>
<string name="title_rule_and">AND</string> <string name="title_rule_and">AND</string>
<string name="title_rule_action">Action</string> <string name="title_rule_action">Action</string>

Loading…
Cancel
Save