@vixoniccom/footbal-score 1.4.1-dev.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/build/main.js +1 -1
- package/build.zip +0 -0
- package/package.json +1 -1
- package/src/App.tsx +6 -1
- package/src/helpers/getFixture.ts +1 -1
package/build.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/App.tsx
CHANGED
|
@@ -25,8 +25,13 @@ export const App: React.FunctionComponent<Props> = ({ data, start }) => {
|
|
|
25
25
|
const timeNow = moment(timeNowFormat, 'h:mma')
|
|
26
26
|
const startTime = moment(parameters.timeStart, 'h:mma')
|
|
27
27
|
const endTime = moment(parameters.timeEnd, 'h:mma')
|
|
28
|
+
// When the end time is earlier than the start time the window crosses midnight,
|
|
29
|
+
// e.g. 10am-1am means [10am, midnight) plus [midnight, 1am)
|
|
30
|
+
const isWithinSchedule = endTime.isAfter(startTime)
|
|
31
|
+
? timeNow.isBetween(startTime, endTime)
|
|
32
|
+
: timeNow.isSameOrAfter(startTime) || timeNow.isBefore(endTime)
|
|
28
33
|
|
|
29
|
-
if (momentLocalStorage == undefined || (
|
|
34
|
+
if (momentLocalStorage == undefined || (isWithinSchedule && momentLocalStorage > updateTime!)) {
|
|
30
35
|
const dataRequest = await getFixture(league, parameters.matchesYesterday, parameters.matchesTomorrow)
|
|
31
36
|
setDataLocal(dataRequest)
|
|
32
37
|
setDataFixture(dataRequest)
|
|
@@ -9,7 +9,7 @@ const FOOTBALL_API_HOST = process.env.FOOTBALL_API_HOST
|
|
|
9
9
|
const FOOTBALL_API_URL = process.env.FOOTBALL_API_URL
|
|
10
10
|
const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000
|
|
11
11
|
|
|
12
|
-
const USE_MOCK =
|
|
12
|
+
const USE_MOCK = false
|
|
13
13
|
|
|
14
14
|
export const getFixture = async (league: string, yesterday?: boolean, tomorrow?: boolean) => {
|
|
15
15
|
if (USE_MOCK) return mockFixtures
|