From e25c8a6ed1a409f44314d1711de88f65e37cade2 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 17 Sep 2022 07:26:33 +0200 Subject: [PATCH] Rule move / subfolder: Added week number placeholder --- FAQ.md | 1 + app/src/main/java/eu/faircode/email/EntityRule.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/FAQ.md b/FAQ.md index c74b16cf15..6dbe74af92 100644 --- a/FAQ.md +++ b/FAQ.md @@ -2592,6 +2592,7 @@ This will be more reliable than forwarding because forwarded messages might be c A *move* action can optionally create subfolders (since version 1.1966) to move messages to, for which you can use the following placeholders: ``` +$week$ $month$ $year$ $domain$ diff --git a/app/src/main/java/eu/faircode/email/EntityRule.java b/app/src/main/java/eu/faircode/email/EntityRule.java index 248d2eb7d3..520bf5b29d 100644 --- a/app/src/main/java/eu/faircode/email/EntityRule.java +++ b/app/src/main/java/eu/faircode/email/EntityRule.java @@ -623,9 +623,11 @@ public class EntityRule { Calendar calendar = Calendar.getInstance(); String year = String.format(Locale.ROOT, "%04d", calendar.get(Calendar.YEAR)); String month = String.format(Locale.ROOT, "%02d", calendar.get(Calendar.MONTH) + 1); + String week = String.format(Locale.ROOT, "%02d", calendar.get(Calendar.WEEK_OF_YEAR)); create = create.replace("$year$", year); create = create.replace("$month$", month); + create = create.replace("$week$", week); String domain = null; if (message.from != null &&