/* ============================================================ Manager mode — DIV Tour Setup Publish & edit the weekly Saturday/Sunday tee times. ============================================================ */ function inputToLabel(v) { // "07:30" -> "7:30 AM" const [h, m] = v.split(":").map(Number); const ap = h >= 12 ? "PM" : "AM"; const hh = h % 12 === 0 ? 12 : h % 12; return `${hh}:${String(m).padStart(2, "0")} ${ap}`; } function labelToInput(label) { const mins = window.YCC.parseTime(label); const h = Math.floor(mins / 60), m = mins % 60; return `${String(h).padStart(2, "0")}:${String(m).padStart(2, "0")}`; } // A full-width add-on toggle row (icon · name · meta · switch) used in Tour Setup. function SideToggle({ on, icon, name, meta, onClick }) { return ( ); } function ManagerDay({ day, slots, onAdd, onEdit, onRemove }) { const Y = window.YCC; const sorted = Y.sortByTime(slots); const [newTime, setNewTime] = useState(""); const [editingId, setEditingId] = useState(null); const [editVal, setEditVal] = useState(""); const claimed = sorted.reduce((n, s) => n + s.players.length, 0); const capacity = sorted.length * 4; return (
Publish the tee times for the weekend of {tour.weekendLabel}. Members claim open spots and their handicaps attach automatically.