@vixoniccom/footbal-score 1.4.0-dev.1 → 1.4.0-dev.2
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/helpers/getFixture.ts +4 -7
package/build.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -6,16 +6,13 @@ if (!process.env.FOOTBALL_API_KEY || !process.env.FOOTBALL_API_HOST || !process.
|
|
|
6
6
|
const FOOTBALL_API_KEY = process.env.FOOTBALL_API_KEY
|
|
7
7
|
const FOOTBALL_API_HOST = process.env.FOOTBALL_API_HOST
|
|
8
8
|
const FOOTBALL_API_URL = process.env.FOOTBALL_API_URL
|
|
9
|
+
const MILLISECONDS_PER_DAY = 24 * 60 * 60 * 1000
|
|
9
10
|
|
|
10
11
|
export const getFixture = async (league: string, yesterday?: boolean, tomorrow?: boolean) => {
|
|
11
12
|
const today = moment().format('YYYY-MM-DD')
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
from = '2023-12-05'
|
|
16
|
-
let to = tomorrow ? moment(Date.now() + 24 * 60 * 60 * 1000).format('YYYY-MM-DD') : today
|
|
17
|
-
to = '2023-12-10'
|
|
18
|
-
|
|
13
|
+
const year = moment().format('YYYY')
|
|
14
|
+
const from = yesterday ? moment(Date.now() - MILLISECONDS_PER_DAY).format('YYYY-MM-DD') : today
|
|
15
|
+
const to = tomorrow ? moment(Date.now() + MILLISECONDS_PER_DAY).format('YYYY-MM-DD') : today
|
|
19
16
|
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
20
17
|
|
|
21
18
|
const options = {
|