Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
import { useMemo } from 'react';
import { useAtomValue } from 'jotai';
import type { WeekStartDay } from '~/utils/clock';
import { resolveWeekStartsOn, systemLocale } from '~/utils/clock';
import { weekStartAtom } from '~/store/weekStart';
/** Resolves the "Week starts on" setting to a concrete day index (0 = Sunday,
* 1 = Monday). Its 'system' branch reads the RUNTIME locale for the same reason
* `useClockFormat` does: `en-GB` normalizes to `en` and would report Sunday. */
export default function useWeekStart(): WeekStartDay {
const preference = useAtomValue(weekStartAtom);
return useMemo(() => resolveWeekStartsOn(preference, systemLocale()), [preference]);
}