tests.
This commit is contained in:
parent
e3ae7fd78f
commit
8fbb8d9775
3 changed files with 42 additions and 2 deletions
|
|
@ -310,7 +310,11 @@ func CalculateMarketSecondsBetween(start, end, marketOpen, marketClose time.Time
|
|||
startMarketClose := NextMarketClose(startEastern, marketClose, isHoliday)
|
||||
|
||||
if (startEastern.Equal(startMarketOpen) || startEastern.After(startMarketOpen)) && startEastern.Before(startMarketClose) {
|
||||
seconds += int64(startMarketClose.Sub(startEastern) / time.Second)
|
||||
if endEastern.Before(startMarketClose) {
|
||||
seconds += int64(endEastern.Sub(startEastern) / time.Second)
|
||||
} else {
|
||||
seconds += int64(startMarketClose.Sub(startEastern) / time.Second)
|
||||
}
|
||||
}
|
||||
|
||||
cursor := NextMarketOpen(startMarketClose, marketOpen, isHoliday)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue