1
0

Use time format specified in radio package.

This commit is contained in:
Alexander Andreev 2022-04-02 04:29:58 +04:00
parent 88e047d210
commit 6f607c830e
Signed by: Arav
GPG Key ID: 1327FE8A374CC86F

View File

@ -81,7 +81,7 @@ func (h *RadioHandlers) Index(w http.ResponseWriter, r *http.Request) {
} }
for i := 0; i < len(songs); i++ { for i := 0; i < len(songs); i++ {
if tim, err := time.Parse("15:04-0700", songs[i].Time); err == nil { if tim, err := time.Parse(radio.SongTimeFormat, songs[i].Time); err == nil {
songs[i].Time = utils.ToClientTimezone(tim, r).Format("15:04") songs[i].Time = utils.ToClientTimezone(tim, r).Format("15:04")
} }
} }
@ -127,7 +127,7 @@ func (h *RadioHandlers) LastSong(w http.ResponseWriter, r *http.Request) {
return return
} }
if tim, err := time.Parse("15:04-0700", song.Time); err == nil { if tim, err := time.Parse(radio.SongTimeFormat, song.Time); err == nil {
song.Time = utils.ToClientTimezone(tim, r).Format("15:04") song.Time = utils.ToClientTimezone(tim, r).Format("15:04")
} }