Fix scheduled series launch: read schedule from draft, apply to draft+published, check every minute, local-time picker; v2.8.1
Publish Container / build (push) Successful in 16m22s
Publish Container / build (push) Successful in 16m22s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
134a2c403e
commit
0ff0b32b97
4 files changed
+68
-43
No files matched your search
+9
-2
@@ -1100,6 +1100,13 @@ function buildSiteContentForSave(siteContent: SiteContent): SiteContent {
|
||||
}
|
||||
}
|
||||
|
||||
function toLocalDatetimeInput(iso: string): string {
|
||||
const d = new Date(iso)
|
||||
if (Number.isNaN(d.getTime())) return ''
|
||||
const pad = (n: number) => String(n).padStart(2, '0')
|
||||
return `${d.getFullYear()}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}T${pad(d.getHours())}:${pad(d.getMinutes())}`
|
||||
}
|
||||
|
||||
function QrCodeImage({ url, label }: { url: string; label: string }) {
|
||||
const canvasRef = React.useRef<HTMLCanvasElement>(null)
|
||||
const [dataUrl, setDataUrl] = React.useState<string>('')
|
||||
@@ -4083,7 +4090,7 @@ const [dashboardNow, setDashboardNow] = useState(() => new Date())
|
||||
<hr style={{ border: 'none', borderTop: '1px solid #2a2518', marginBottom: '1.5rem' }} />
|
||||
<h3 style={{ marginBottom: '0.35rem', fontSize: '1rem' }}>Schedule Auto Series Launch</h3>
|
||||
<p className="admin-stats-note" style={{ marginBottom: '1rem' }}>
|
||||
Set one date & time to automatically archive the current series and swap in new content for the Series card, Start Here section, and Companion Study Guide. The server checks every hour. Leave optional fields blank to keep the current values unchanged.
|
||||
Set one date & time to automatically archive the current series and swap in new content for the Series card, Start Here section, and Companion Study Guide. The server checks every minute. Leave optional fields blank to keep the current values unchanged.
|
||||
</p>
|
||||
{sched?.triggersAt && (
|
||||
<div style={{ background: 'rgba(201,168,76,0.08)', border: '1px solid rgba(201,168,76,0.25)', borderRadius: '10px', padding: '0.8rem 1rem', marginBottom: '1rem' }}>
|
||||
@@ -4099,7 +4106,7 @@ const [dashboardNow, setDashboardNow] = useState(() => new Date())
|
||||
<input
|
||||
id="sched-triggers-at"
|
||||
type="datetime-local"
|
||||
value={sched?.triggersAt ? new Date(sched.triggersAt).toISOString().slice(0, 16) : ''}
|
||||
value={sched?.triggersAt ? toLocalDatetimeInput(sched.triggersAt) : ''}
|
||||
onChange={e => patch({ triggersAt: e.target.value ? new Date(e.target.value).toISOString() : '' })}
|
||||
/>
|
||||
</div>
|
||||
|
||||
Reference in new issue
Block a user