MCPcopy Create free account
hub / github.com/Tron521/codex-console-temp / formatBeijingDateTime

Function formatBeijingDateTime

static/js/payment.js:1392–1411  ·  view source on GitHub ↗
(dateStr)

Source from the content-addressed store, hash-verified

1390}
1391
1392function formatBeijingDateTime(dateStr) {
1393 if (!dateStr) return "-";
1394 const raw = String(dateStr).trim();
1395 if (!raw) return "-";
1396 // 后端多数时间字段是 UTC naive(无时区),这里按 UTC 解析后固定转北京时间显示
1397 const normalized = /[zZ]$|[+\-]\d{2}:\d{2}$/.test(raw) ? raw : `${raw}Z`;
1398 const date = new Date(normalized);
1399 if (Number.isNaN(date.getTime())) {
1400 return format.date(dateStr);
1401 }
1402 return date.toLocaleString("zh-CN", {
1403 timeZone: "Asia/Shanghai",
1404 year: "numeric",
1405 month: "2-digit",
1406 day: "2-digit",
1407 hour: "2-digit",
1408 minute: "2-digit",
1409 hour12: false,
1410 });
1411}
1412
1413function updateVendorProgressUi(progressPayload, taskId) {
1414 const progress = Math.max(0, Math.min(100, Number(progressPayload?.progress || 0)));

Callers 1

runnerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected