From 069866961dc9f9ac20579147608dafdac5a4f1ca Mon Sep 17 00:00:00 2001 From: cskoven Date: Wed, 16 Oct 2019 16:16:16 +0200 Subject: [PATCH 1/2] adjust ticker column width, to make room for longer ticker codes --- layout.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layout.go b/layout.go index 559425e..8c09445 100644 --- a/layout.go +++ b/layout.go @@ -37,7 +37,7 @@ type Layout struct { func NewLayout() *Layout { layout := &Layout{} layout.columns = []Column{ - {-7, `Ticker`, `Ticker`, nil}, + {-10, `Ticker`, `Ticker`, nil}, {10, `LastTrade`, `Last`, currency}, {10, `Change`, `Change`, currency}, {10, `ChangePct`, `Change%`, last}, From 2dd38e80e8a8cab524e799b8fe2b758a662ccac4 Mon Sep 17 00:00:00 2001 From: cskoven Date: Wed, 16 Oct 2019 16:19:54 +0200 Subject: [PATCH 2/2] fix timezone error, to use local timezone in both places --- layout.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/layout.go b/layout.go index 8c09445..9002eb2 100644 --- a/layout.go +++ b/layout.go @@ -80,6 +80,7 @@ func (layout *Layout) Market(market *Market) string { // and the list of given stock quotes. It returns formatted string with // all the necessary markup. func (layout *Layout) Quotes(quotes *Quotes) string { + zonename, _ := time.Now().In(time.Local).Zone() if ok, err := quotes.Ok(); !ok { // If there was an error fetching stock quotes... return err // then simply return the error string. } @@ -89,7 +90,7 @@ func (layout *Layout) Quotes(quotes *Quotes) string { Header string // Formatted header line. Stocks []Stock // List of formatted stock quotes. }{ - time.Now().Format(`3:04:05pm PST`), + time.Now().Format(`3:04:05pm ` + zonename), layout.Header(quotes.profile), layout.prettify(quotes), }