added demo quiz reset option. Added timer for next available daily quiz

This commit is contained in:
masongga
2026-05-24 07:48:51 -06:00
parent 4998576e64
commit 1a151b5c7c
6 changed files with 199 additions and 7 deletions

View File

@@ -16,6 +16,9 @@ import {
getStreakMilestoneBonus,
} from "@/lib/coins";
import { createClient } from "@/lib/supabase/client";
import { getTodayDateKey } from "@/lib/date-keys";
export { getTodayDateKey };
export type Habit = {
id: string;
@@ -43,10 +46,6 @@ type HabitRow = {
const habitSelectFields =
"id, name, streak, last_completed_on, claimed_streak_milestones";
export function getTodayDateKey(date = new Date()) {
return date.toISOString().slice(0, 10);
}
function getDayDiff(fromDate: string, toDate: string) {
const from = new Date(`${fromDate}T00:00:00`);
const to = new Date(`${toDate}T00:00:00`);