Fix daily puzzle rotation timezone issue

- Added lib/dateUtils.ts for consistent timezone handling
- Updated app/page.tsx and app/api/daily/route.ts to use Europe/Berlin timezone
- Updated lib/gameState.ts to sync client-side daily check with server time
- Exposed TZ env var to client in next.config.ts
This commit is contained in:
Hördle Bot
2025-11-22 00:44:14 +01:00
parent 3e0fa430a3
commit 4f8524c286
6 changed files with 66 additions and 10 deletions

View File

@@ -1,4 +1,5 @@
import Game from '@/components/Game';
import { getTodayISOString } from '@/lib/dateUtils';
export const dynamic = 'force-dynamic';
@@ -14,7 +15,7 @@ if (process.env.NODE_ENV !== 'production') globalForPrisma.prisma = prisma;
async function getDailyPuzzle() {
try {
const today = new Date().toISOString().split('T')[0];
const today = getTodayISOString();
console.log(`[getDailyPuzzle] Checking puzzle for date: ${today}`);
let dailyPuzzle = await prisma.dailyPuzzle.findUnique({