import { useState } from 'react' import { Globe } from 'lucide-react' import { Panel } from '../components/ui' import { useSetTimeZone } from '../tools/recruitmatch/taskQueries' import { useTaskQueue } from '../tools/recruitmatch/taskQueries' // A short list rather than every IANA zone. These are the zones a US federal contracting firm actually // operates in, and a searchable list of six hundred names is worse than five correct ones. The server // validates against the full catalog regardless, so a zone typed by any other client still has to exist. const ZONES = [ 'America/New_York', 'America/Chicago', 'America/Denver', 'America/Phoenix', 'America/Los_Angeles', 'America/Anchorage', 'Pacific/Honolulu', 'UTC', ] // The organization's working day. Owner only, because changing it moves what "today" means for every // count in the product: the task queue, the daily report, and every period rollup. export function TimeZonePanel() { const q = useTaskQueue('me', false) const set = useSetTimeZone() const current = q.data?.time_zone ?? '' const [choice, setChoice] = useState('') return (

Every day, week and quarter in this product is counted in this timezone. An activity logged at 8pm Eastern is the next day in UTC, so this is what decides whether that evening's work lands on the day it was actually done.

{set.isError &&

{(set.error as Error).message}

} {set.isSuccess && !set.isPending && (

Saved. Every count in the product now uses this day boundary.

)}

Owner only. It is one setting per organization rather than per person, because two people seeing different numbers for the same desk could not reconcile them with each other or with an invoice.

) }