Compare commits

..

No commits in common. "1fdbf56aa7f2f95d042ac28bdb3a9ca8cae63244" and "9b938dad97d32334f44d85d39efd306caa1c365d" have entirely different histories.

2 changed files with 4 additions and 7 deletions

View File

@ -42,16 +42,13 @@ func main() {
log.Fatal(err)
}
defer conn.Release()
updateForecast(context.Background(), conn)
}
func updateForecast(ctx context.Context, conn *database.Conn) {
if _, err := conn.Exec(ctx, "set role to admin"); err != nil {
if _, err := conn.Exec(context.Background(), "set role to admin"); err != nil {
log.Fatal(err)
}
var stationURL string
if err := conn.QueryRow(ctx, `
if err := conn.QueryRow(context.Background(), `
select station_uri
from weather_forecast
`).Scan(
@ -71,7 +68,7 @@ func updateForecast(ctx context.Context, conn *database.Conn) {
}
for _, forecast := range result.Forecasts {
if _, err := conn.Exec(ctx, `
if _, err := db.Exec(context.Background(), `
update weather_forecast
set weather_condition_id = $1
, day_temperature = $2

View File

@ -121,7 +121,7 @@ func mustRenderLayout(w io.Writer, user *auth.User, company *auth.Company, templ
return FormatPrice(price, user.Locale.Language, user.Locale.CurrencyPattern, company.DecimalDigits, company.CurrencySymbol)
},
"dayOfWeek": func(time time.Time) template.HTML {
return template.HTML(`<time datetime="` + time.Format(database.ISODateFormat) + `">` + user.Locale.GetC(LongDayNames[time.Weekday()], "day") + "</time>")
return template.HTML(`<time datetime="` + time.Format(database.ISODateFormat) + `">` + LongDayNames[time.Weekday()] + "</time>")
},
"formatDate": func(time time.Time) template.HTML {
return template.HTML(`<time datetime="` + time.Format(database.ISODateFormat) + `">` + time.Format("02/01/2006") + "</time>")