summary refs log tree commit diff stats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/aerc.conf.in14
-rw-r--r--config/config.go8
-rw-r--r--config/triggers.go2
3 files changed, 22 insertions, 2 deletions
diff --git a/config/aerc.conf.in b/config/aerc.conf.in
index b9381a8..0421901 100644
--- a/config/aerc.conf.in
+++ b/config/aerc.conf.in
@@ -16,6 +16,20 @@ index-format=%D %-17.17n %Z %s
 timestamp-format=2006-01-02 03:04 PM
 
 #
+# Index-only time format for messages that were received/sent today.
+# If this is not specified, timestamp-format is used instead.
+#
+# Default: ""
+today-time-format=
+
+#
+# Index-only time format for messages that were received/sent this year.
+# If this is not specified, timestamp-format is used instead.
+#
+# Default: ""
+this-year-time-format=
+
+#
 # Width of the sidebar, including the border.
 #
 # Default: 20
diff --git a/config/config.go b/config/config.go
index af9c63b..dfcbd4d 100644
--- a/config/config.go
+++ b/config/config.go
@@ -29,6 +29,8 @@ type GeneralConfig struct {
 type UIConfig struct {
 	IndexFormat         string        `ini:"index-format"`
 	TimestampFormat     string        `ini:"timestamp-format"`
+	ThisDayTimeFormat   string        `ini:"this-day-time-format"`
+	ThisYearTimeFormat  string        `ini:"this-year-time-format"`
 	ShowHeaders         []string      `delim:","`
 	RenderAccountTabs   string        `ini:"render-account-tabs"`
 	PinnedTabMarker     string        `ini:"pinned-tab-marker"`
@@ -491,8 +493,10 @@ func LoadConfigFromFile(root *string, sharedir string) (*AercConfig, error) {
 		Ini: file,
 
 		Ui: UIConfig{
-			IndexFormat:     "%D %-17.17n %s",
-			TimestampFormat: "2006-01-02 03:04 PM",
+			IndexFormat:        "%D %-17.17n %s",
+			TimestampFormat:    "2006-01-02 03:04 PM",
+			ThisDayTimeFormat:  "",
+			ThisYearTimeFormat: "",
 			ShowHeaders: []string{
 				"From", "To", "Cc", "Bcc", "Subject", "Date",
 			},
diff --git a/config/triggers.go b/config/triggers.go
index 847a10f..4777371 100644
--- a/config/triggers.go
+++ b/config/triggers.go
@@ -38,6 +38,8 @@ func (trig *TriggersConfig) ExecNewEmail(account *AccountConfig,
 		func(part string) (string, error) {
 			formatstr, args, err := format.ParseMessageFormat(
 				part, conf.Ui.TimestampFormat,
+				conf.Ui.ThisDayTimeFormat,
+				conf.Ui.ThisYearTimeFormat,
 				format.Ctx{
 					FromAddress: account.From,
 					AccountName: account.Name,