@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/build.zip CHANGED
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vixoniccom/footbal-score",
3
3
  "alias": "Resultados Deportivos",
4
- "version": "1.4.1-dev.0",
4
+ "version": "1.4.1",
5
5
  "description": "Muestra resultados en vivo de fútbol.",
6
6
  "main": "main.js",
7
7
  "author": "",
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 || (timeNow.isBetween(startTime, endTime) && momentLocalStorage > updateTime!)) {
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 = true
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