redirect to bibdle.dev and components

This commit is contained in:
George Powell
2025-12-19 02:53:45 -05:00
parent 1feab881b1
commit 68a946a0a0
10 changed files with 415 additions and 221 deletions

View File

@@ -6,13 +6,10 @@ import { fail } from '@sveltejs/kit';
import { fetchRandomVerse } from '$lib/server/bible-api';
import { getBookById } from '$lib/server/bible';
import type { DailyVerse } from '$lib/server/db/schema';
import type { BibleBook } from '$lib/types/bible';
import crypto from 'node:crypto';
async function getTodayVerse(): Promise<DailyVerse> {
const today = new Date();
today.setUTCHours(0, 0, 0, 0);
const dateStr = today.toISOString().slice(0, 10);
const dateStr = new Date().toLocaleDateString('en-CA', { timeZone: 'America/New_York' });
const existing = await db.select().from(dailyVerses).where(eq(dailyVerses.date, dateStr)).limit(1);
if (existing.length > 0) {