fix(#720): add timeline timezone

pull/296/head
Rakov 2 years ago
parent 642e3809dc
commit 8dce04b35d
  1. 9
      src/requests/getMatches/getTimelineMatches.tsx

@ -18,7 +18,14 @@ export type MatchesTimeline = {
} }
export const getTimelineMatches = (sportId?: number): Promise<MatchesTimeline> => { export const getTimelineMatches = (sportId?: number): Promise<MatchesTimeline> => {
const url = new URL(`${API_ROOT}/v1/matches/timeline`) const getTimezoneOffset = () => {
const offset = new Date().getTimezoneOffset()
if (offset === 0) return offset
return -(offset)
}
const timeZoneOffset = getTimezoneOffset()
const url = new URL(`${API_ROOT}/v1/broadcasts/timeline/${timeZoneOffset}`)
if (sportId) { if (sportId) {
url.searchParams.append('sport_id', `${sportId}`) url.searchParams.append('sport_id', `${sportId}`)

Loading…
Cancel
Save