|
@@ -64,13 +64,17 @@ func formatGames(games []game.Game, mode string) string {
|
|
|
b.WriteString("| Game | Store | Price | Period |\n")
|
|
b.WriteString("| Game | Store | Price | Period |\n")
|
|
|
b.WriteString("|---|---|---|---|\n")
|
|
b.WriteString("|---|---|---|---|\n")
|
|
|
for _, g := range games {
|
|
for _, g := range games {
|
|
|
|
|
+ dateFmt := os.Getenv("CHEAPO_DATE_FORMAT")
|
|
|
|
|
+ if dateFmt == "" {
|
|
|
|
|
+ dateFmt = "02.01."
|
|
|
|
|
+ }
|
|
|
period := "—"
|
|
period := "—"
|
|
|
if g.Kind == "upcoming" && !g.StartDate.IsZero() && !g.EndDate.IsZero() {
|
|
if g.Kind == "upcoming" && !g.StartDate.IsZero() && !g.EndDate.IsZero() {
|
|
|
period = fmt.Sprintf("from %s, until %s",
|
|
period = fmt.Sprintf("from %s, until %s",
|
|
|
- g.StartDate.UTC().Format("2006-01-02"),
|
|
|
|
|
- g.EndDate.UTC().Format("2006-01-02"))
|
|
|
|
|
|
|
+ g.StartDate.Local().Format(dateFmt),
|
|
|
|
|
+ g.EndDate.Local().Format(dateFmt))
|
|
|
} else if !g.EndDate.IsZero() {
|
|
} else if !g.EndDate.IsZero() {
|
|
|
- period = "until " + g.EndDate.UTC().Format("2006-01-02")
|
|
|
|
|
|
|
+ period = "until " + g.EndDate.Local().Format(dateFmt)
|
|
|
}
|
|
}
|
|
|
fmt.Fprintf(&b, "| **%s** | [%s](%s) | %s | %s |\n",
|
|
fmt.Fprintf(&b, "| **%s** | [%s](%s) | %s | %s |\n",
|
|
|
escapePipe(g.Title), g.Store, g.URL, priceCell(g), period)
|
|
escapePipe(g.Title), g.Store, g.URL, priceCell(g), period)
|