Date format was moved out to a const.
This commit is contained in:
parent
95e9d97a22
commit
8e0d5e4fb7
@ -7,6 +7,8 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const MostListenedDateFormat = "02 January 2006"
|
||||||
|
|
||||||
type MostListenedSong struct {
|
type MostListenedSong struct {
|
||||||
Listeners int
|
Listeners int
|
||||||
Date time.Time
|
Date time.Time
|
||||||
@ -14,7 +16,7 @@ type MostListenedSong struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (mls *MostListenedSong) DateString() string {
|
func (mls *MostListenedSong) DateString() string {
|
||||||
return mls.Date.Format("02 January 2006")
|
return mls.Date.Format(MostListenedDateFormat)
|
||||||
}
|
}
|
||||||
|
|
||||||
var mostListened MostListenedSong
|
var mostListened MostListenedSong
|
||||||
|
Loading…
Reference in New Issue
Block a user