feat(admin+api+player): 优胜赛结算态、禁止新增单场与钱包流水展示优化
- API/管理端:优胜赛 SETTLED 后禁止新增单场,列表与子页展示结算状态 - 玩家端:已结算 outright 只读展示并高亮冠军 - 管理端:结算后 stale 标记驱动列表刷新;财务流水时间与备注 i18n 优化 - shared:txDisplayAmount 与 LEAGUE_OUTRIGHT_SETTLED 错误码
This commit is contained in:
39
apps/admin/src/utils/format-datetime.ts
Normal file
39
apps/admin/src/utils/format-datetime.ts
Normal file
@@ -0,0 +1,39 @@
|
||||
import { getAdminLocale } from '../i18n';
|
||||
import type { AdminLocale } from '../i18n/admin-messages';
|
||||
|
||||
function resolveLocale(locale?: AdminLocale): AdminLocale {
|
||||
return locale ?? getAdminLocale();
|
||||
}
|
||||
|
||||
/** 列表展示:年月日 */
|
||||
export function formatAdminDateTimeBrief(
|
||||
value: string | null | undefined,
|
||||
locale?: AdminLocale,
|
||||
): string {
|
||||
if (!value) return '—';
|
||||
const d = new Date(value);
|
||||
if (Number.isNaN(d.getTime())) return '—';
|
||||
return d.toLocaleString(resolveLocale(locale), {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
});
|
||||
}
|
||||
|
||||
/** 悬停详情:含秒 */
|
||||
export function formatAdminDateTimeFull(
|
||||
value: string | null | undefined,
|
||||
locale?: AdminLocale,
|
||||
): string {
|
||||
if (!value) return '—';
|
||||
const d = new Date(value);
|
||||
if (Number.isNaN(d.getTime())) return '—';
|
||||
return d.toLocaleString(resolveLocale(locale), {
|
||||
year: 'numeric',
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
second: '2-digit',
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user