Skip to content

Commit

Permalink
Release 1.0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
ericm committed Nov 2, 2020
1 parent e629f34 commit 1e9523c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package api

// Version of stonks
const Version = "1.0.8"
const Version = "1.0.9"
5 changes: 3 additions & 2 deletions graph/graph.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package graph
import (
"fmt"
"strings"
"time"

"github.com/ericm/stonks/api"
"github.com/shopspring/decimal"
Expand Down Expand Up @@ -33,7 +34,7 @@ func borderHorizontal(out *string, width int) {
}

// GenerateGraph with ASCII graph with ANSI escapes
func GenerateGraph(chart *api.Chart, width int, height int, chartTheme ChartTheme) (string, error) {
func GenerateGraph(chart *api.Chart, width int, height int, chartTheme ChartTheme, timezone *time.Location) (string, error) {
out := "┏"
maxSize := len(strings.Split(chart.High.String(), ".")[0]) + 3
borderHorizontal(&out, width+maxSize+3)
Expand Down Expand Up @@ -228,7 +229,7 @@ retryFooter:
if chart.End.Unix()-chart.Start.Unix() > 86400 {
format = dayFormat
}
t := bar.Timestamp.Time().Format(format)
t := bar.Timestamp.Time().In(timezone).Format(format)
if lastLen > 0 {
for _i := 0; _i < diff-len(t); _i++ {
footer += " "
Expand Down
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func main() {
fmt.Println(err.Error())
continue
}
g, _ := graph.GenerateGraph(chart, *width, viper.GetInt("config.favourites_height"), chartTheme)
g, _ := graph.GenerateGraph(chart, *width, viper.GetInt("config.favourites_height"), chartTheme, time.Local)
fmt.Print(g)
}
}
Expand All @@ -165,7 +165,7 @@ func main() {
fmt.Println(err.Error())
os.Exit(1)
}
g, _ := graph.GenerateGraph(chart, *width, viper.GetInt("config.standalone_height"), chartTheme)
g, _ := graph.GenerateGraph(chart, *width, viper.GetInt("config.standalone_height"), chartTheme, time.Local)
fmt.Print(g)
}
},
Expand Down

0 comments on commit 1e9523c

Please sign in to comment.