summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2021-11-06 17:32:38 +0100
committerRobin Jarry <robin@jarry.cc>2021-11-06 17:34:20 +0100
commit84146e23b384e42c63287e3519e70b0a6ea3100f (patch)
tree4b7994c45404e0dfcf85c5c9dfc1284fcc0eb6e0 /config
parent02e7d8aca88d433062e00fa2988e533944a563f4 (diff)
downloadaerc-84146e23b384e42c63287e3519e70b0a6ea3100f.zip
index: add this-week-time-format
Also allow specific time format for messages received within the last 7 days. Signed-off-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'config')
-rw-r--r--config/aerc.conf.in7
-rw-r--r--config/config.go2
-rw-r--r--config/triggers.go1
3 files changed, 10 insertions, 0 deletions
diff --git a/config/aerc.conf.in b/config/aerc.conf.in
index cd40af5..c57c774 100644
--- a/config/aerc.conf.in
+++ b/config/aerc.conf.in
@@ -23,6 +23,13 @@ timestamp-format=2006-01-02 03:04 PM
this-day-time-format=
#
+# Index-only time format for messages that were received/sent within the last
+# 7 days. If this is not specified, timestamp-format is used instead.
+#
+# Default: ""
+this-week-time-format=
+
+#
# Index-only time format for messages that were received/sent this year.
# If this is not specified, timestamp-format is used instead.
#
diff --git a/config/config.go b/config/config.go
index dcfdd24..58aa062 100644
--- a/config/config.go
+++ b/config/config.go
@@ -30,6 +30,7 @@ type UIConfig struct {
IndexFormat string `ini:"index-format"`
TimestampFormat string `ini:"timestamp-format"`
ThisDayTimeFormat string `ini:"this-day-time-format"`
+ ThisWeekTimeFormat string `ini:"this-week-time-format"`
ThisYearTimeFormat string `ini:"this-year-time-format"`
ShowHeaders []string `delim:","`
RenderAccountTabs string `ini:"render-account-tabs"`
@@ -496,6 +497,7 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
IndexFormat: "%D %-17.17n %s",
TimestampFormat: "2006-01-02 03:04 PM",
ThisDayTimeFormat: "",
+ ThisWeekTimeFormat: "",
ThisYearTimeFormat: "",
ShowHeaders: []string{
"From", "To", "Cc", "Bcc", "Subject", "Date",
diff --git a/config/triggers.go b/config/triggers.go
index f00f638..3005d59 100644
--- a/config/triggers.go
+++ b/config/triggers.go
@@ -39,6 +39,7 @@ func (trig *TriggersConfig) ExecNewEmail(account *AccountConfig,
formatstr, args, err := format.ParseMessageFormat(
part, conf.Ui.TimestampFormat,
conf.Ui.ThisDayTimeFormat,
+ conf.Ui.ThisWeekTimeFormat,
conf.Ui.ThisYearTimeFormat,
format.Ctx{
FromAddress: account.From,