diff --git a/app/components/CloudConfigModal.jsx b/app/components/CloudConfigModal.jsx index d62781a..da39be0 100644 --- a/app/components/CloudConfigModal.jsx +++ b/app/components/CloudConfigModal.jsx @@ -41,10 +41,10 @@ export default function CloudConfigModal({ onConfirm, onCancel, type = 'empty' } : '是否将本地配置同步到云端?'}

- -
diff --git a/app/components/FundCard.jsx b/app/components/FundCard.jsx index a929907..75fd361 100644 --- a/app/components/FundCard.jsx +++ b/app/components/FundCard.jsx @@ -34,6 +34,17 @@ const getBrowserTimeZone = () => { const TZ = getBrowserTimeZone(); const toTz = (input) => (input ? dayjs.tz(input, TZ) : dayjs().tz(TZ)); +const formatDisplayDate = (value) => { + if (!value) return '-'; + + const d = toTz(value); + if (!d.isValid()) return value; + + const hasTime = /[T\s]\d{2}:\d{2}/.test(String(value)); + + return hasTime ? d.format('MM-DD HH:mm') : d.format('MM-DD'); +}; + export default function FundCard({ fund: f, todayStr, @@ -126,7 +137,11 @@ export default function FundCard({
{f.noValuation ? '净值日期' : '估值时间'} - {f.noValuation ? (f.jzrq || '-') : (f.gztime || f.time || '-')} + + {f.noValuation + ? formatDisplayDate(f.jzrq) + : formatDisplayDate(f.gztime || f.time)} +