Skip to content
Snippets Groups Projects
Commit 59ba807c authored by Daniel Naude's avatar Daniel Naude
Browse files

Refactor TradingHours struct to be a slice instead of array of 7 elements

parent c6a4c8d0
No related branches found
No related tags found
No related merge requests found
......@@ -276,12 +276,12 @@ func formatTimestampsWithTimeZoneInSlice(fieldValue reflect.Value, location *tim
// TradingHours represents an array of (StartTime,EndTime) pairs, one for each day of the week.
// The array is 0 indexed, with 0 being Monday and 6 being Sunday.
type TradingHours [7]struct {
type TradingHours []struct {
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
}
func (t *TradingHours) Validate() bool {
func (t TradingHours) Validate() bool {
if t == nil {
return false
}
......@@ -327,7 +327,7 @@ func (t *TradingHours) Validate() bool {
return true
}
func (t *TradingHours) String() string {
func (t TradingHours) String() string {
var dayMap = map[int]string{
0: "Mon",
1: "Tue",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment