summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--widgets/msgviewer.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/widgets/msgviewer.go b/widgets/msgviewer.go
index 6de729e..b573201 100644
--- a/widgets/msgviewer.go
+++ b/widgets/msgviewer.go
@@ -55,7 +55,7 @@ func NewMessageViewer(acct *AccountView, conf *config.AercConfig,
 		func(header string) ui.Drawable {
 			return &HeaderView{
 				Name:  header,
-				Value: fmtHeader(msg, header),
+				Value: fmtHeader(msg, header, conf.Ui.TimestampFormat),
 			}
 		},
 	)
@@ -93,7 +93,7 @@ func NewMessageViewer(acct *AccountView, conf *config.AercConfig,
 	return mv
 }
 
-func fmtHeader(msg *models.MessageInfo, header string) string {
+func fmtHeader(msg *models.MessageInfo, header string, timefmt string) string {
 	switch header {
 	case "From":
 		return models.FormatAddresses(msg.Envelope.From)
@@ -104,7 +104,7 @@ func fmtHeader(msg *models.MessageInfo, header string) string {
 	case "Bcc":
 		return models.FormatAddresses(msg.Envelope.Bcc)
 	case "Date":
-		return msg.Envelope.Date.Format("Mon Jan 2, 2006 at 3:04 PM")
+		return msg.Envelope.Date.Local().Format(timefmt)
 	case "Subject":
 		return msg.Envelope.Subject
 	default:
lor: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#!/usr/bin/zsh
# Regenerate html files.

rm html/**/*.html

process() {
  vim -c "TOhtml | w | qa" $1

  sed -i 's,<title>\~/mu/,<title>Mu - ,' $1.html
  sed -i 's,\.html</title>,</title>,' $1.html
  sed -i 's/^\*.*/* { font-size: 1.05em; }/g' $1.html
  # tweak contrast
  sed -i 's/^\.Constant .*/.Constant { color: #00a0a0; }/' $1.html
  sed -i 's/^\.muControl .*/.muControl { color: #c0a020; }/' $1.html
  sed -i 's/^\.Comment .*/.Comment { color: #9090ff; }/' $1.html
  sed -i 's/^\.Delimiter .*/.Delimiter { color: #a04060; }/' $1.html  # not meant to be read/ can be lower-contrast

  mv -i $1.html html/`dirname $1`
}

for f in *.cc *.mu edit/*.mu
do
  process $f
done