diff options
author | Bence Ferdinandy <bence@ferdinandy.com> | 2022-10-19 13:21:41 +0200 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2022-10-19 20:27:58 +0200 |
commit | c3bb3aa2a8908eaeb201a740fb12d70968cc3bac (patch) | |
tree | 44cb8ade5dcbd03077b8a461f236b16149a25c9f /lib/format/format.go | |
parent | 6eed15c579017099c31d73821e70bc363e0fe7b8 (diff) | |
download | aerc-c3bb3aa2a8908eaeb201a740fb12d70968cc3bac.tar.gz |
msgview: add separate date formatting
The ThisDayTimeFormat and friends are missing from the message view
which just uses the message list's default setting. This might not be
desirable since the amount of space available is different. Introduce
separate settings for formatting dates in the message view.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'lib/format/format.go')
-rw-r--r-- | lib/format/format.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/format/format.go b/lib/format/format.go index 055e2c73..e340c496 100644 --- a/lib/format/format.go +++ b/lib/format/format.go @@ -178,7 +178,7 @@ func ParseMessageFormat(format string, timeFmt string, thisDayTimeFmt string, } retval = append(retval, 's') args = append(args, - dummyIfZeroDate(date.Local(), + DummyIfZeroDate(date.Local(), timeFmt, thisDayTimeFmt, thisWeekTimeFmt, thisYearTimeFmt)) case 'D': @@ -188,7 +188,7 @@ func ParseMessageFormat(format string, timeFmt string, thisDayTimeFmt string, } retval = append(retval, 's') args = append(args, - dummyIfZeroDate(date.Local(), + DummyIfZeroDate(date.Local(), timeFmt, thisDayTimeFmt, thisWeekTimeFmt, thisYearTimeFmt)) case 'f': @@ -395,7 +395,7 @@ handle_end_error: errors.New("reached end of string while parsing message format") } -func dummyIfZeroDate(date time.Time, format string, todayFormat string, +func DummyIfZeroDate(date time.Time, format string, todayFormat string, thisWeekFormat string, thisYearFormat string, ) string { if date.IsZero() { |