fix timezones?

This commit is contained in:
2025-06-01 11:54:41 +02:00
parent a18f050204
commit 5270c16437
2 changed files with 8 additions and 2 deletions

View File

@@ -27,7 +27,7 @@ import {
MinusCircle,
} from 'lucide-react'
import { useSession } from 'next-auth/react'
import { useFormatter } from 'next-intl'
import { useFormatter, useTimeZone } from 'next-intl'
import Link from 'next/link'
import { useMemo, useState } from 'react'
@@ -60,6 +60,7 @@ function openTranscript(gameNumber: number): void {
}
const useColumns = () => {
const format = useFormatter()
const timeZone = useTimeZone()
const session = useSession()
const isAdmin = session.data?.user.role === 'admin'
return useMemo(
@@ -154,6 +155,7 @@ const useColumns = () => {
year: 'numeric',
month: '2-digit',
day: '2-digit',
timeZone,
})}
</span>
),
@@ -170,6 +172,7 @@ const useColumns = () => {
{format.dateTime(info.getValue(), {
hour: '2-digit',
minute: '2-digit',
timeZone,
})}
</span>
),

View File

@@ -16,6 +16,7 @@ import type React from 'react'
import { useState } from 'react'
import { GamesTable } from '@/app/(home)/players/[id]/_components/games-table'
import { TimeZoneProvider } from '@/components/timezone-provider'
import { MmrTrendChart } from '@/app/(home)/players/[id]/_components/mmr-trend-chart'
import { WinrateTrendChart } from '@/app/(home)/players/[id]/_components/winrate-trend-chart'
import { OpponentsTable } from '@/app/(home)/players/[id]/_components/opponents-table'
@@ -427,7 +428,9 @@ export function UserInfo() {
<TabsContent value='matches' className='m-0'>
<div className='overflow-hidden rounded-lg border'>
<div className='overflow-x-auto'>
<TimeZoneProvider>
<GamesTable games={filteredGames} />
</TimeZoneProvider>
</div>
</div>
</TabsContent>