mirror of
https://github.com/ershisan99/www.git
synced 2025-12-18 12:34:17 +00:00
maybe fix timezones?
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
'use client'
|
||||||
import { PlayerAvatar } from '@/app/(home)/major-league-balatro/_components/player-avatar'
|
import { PlayerAvatar } from '@/app/(home)/major-league-balatro/_components/player-avatar'
|
||||||
import { players } from '@/app/(home)/major-league-balatro/_constants/players'
|
import { players } from '@/app/(home)/major-league-balatro/_constants/players'
|
||||||
import type { Match } from '@/app/(home)/major-league-balatro/types'
|
import type { Match } from '@/app/(home)/major-league-balatro/types'
|
||||||
@@ -17,7 +18,7 @@ import {
|
|||||||
} from '@/components/ui/mobile-tooltip'
|
} from '@/components/ui/mobile-tooltip'
|
||||||
import { SiTwitch, SiYoutube } from '@icons-pack/react-simple-icons'
|
import { SiTwitch, SiYoutube } from '@icons-pack/react-simple-icons'
|
||||||
import { TvMinimalPlay } from 'lucide-react'
|
import { TvMinimalPlay } from 'lucide-react'
|
||||||
import { useFormatter } from 'next-intl'
|
import { useFormatter, useTimeZone } from 'next-intl'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import type React from 'react'
|
import type React from 'react'
|
||||||
|
|
||||||
@@ -27,12 +28,15 @@ type MatchCardProps = {
|
|||||||
export const MatchCard = ({ match }: MatchCardProps) => {
|
export const MatchCard = ({ match }: MatchCardProps) => {
|
||||||
const formatter = useFormatter()
|
const formatter = useFormatter()
|
||||||
const { player1Id, player2Id, datetime, completed, vod1, vod2 } = match
|
const { player1Id, player2Id, datetime, completed, vod1, vod2 } = match
|
||||||
|
const timeZone = useTimeZone()
|
||||||
const date = formatter.dateTime(datetime, {
|
const date = formatter.dateTime(datetime, {
|
||||||
month: 'long',
|
month: 'long',
|
||||||
day: 'numeric',
|
day: 'numeric',
|
||||||
|
timeZone,
|
||||||
})
|
})
|
||||||
const time = formatter.dateTime(datetime, {
|
const time = formatter.dateTime(datetime, {
|
||||||
timeStyle: 'short',
|
timeStyle: 'short',
|
||||||
|
timeZone,
|
||||||
})
|
})
|
||||||
const player1 = players[player1Id]
|
const player1 = players[player1Id]
|
||||||
const player2 = players[player2Id]
|
const player2 = players[player2Id]
|
||||||
|
|||||||
Reference in New Issue
Block a user