added demo quiz reset option. Added timer for next available daily quiz
This commit is contained in:
@@ -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`);
|
||||
|
||||
Reference in New Issue
Block a user