Absolute/relative time

This commit is contained in:
M66B 2021-03-27 20:02:54 +01:00
parent 33b49d8541
commit 1b42e8c677
5 changed files with 13 additions and 10 deletions

3
FAQ.md
View File

@ -2068,7 +2068,8 @@ The following rule conditions are available:
* Subject contains
* Has attachments
* 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 conditions are optional, but there needs to be at least one condition, to prevent matching all messages.

View File

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

View File

@ -332,7 +332,7 @@ public class FragmentRule extends FragmentBase {
@Override
public void onClick(View v) {
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);
Object time = tvDateAfter.getTag();
@ -350,7 +350,7 @@ public class FragmentRule extends FragmentBase {
@Override
public void onClick(View v) {
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);
Object time = tvDateBefore.getTag();

View File

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

View File

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