15 lines
387 B
TypeScript
15 lines
387 B
TypeScript
export function formatDateTime(value?: string | null) {
|
|
if (!value) return "暂未设置";
|
|
|
|
return new Intl.DateTimeFormat("zh-CN", {
|
|
month: "2-digit",
|
|
day: "2-digit",
|
|
hour: "2-digit",
|
|
minute: "2-digit"
|
|
}).format(new Date(value));
|
|
}
|
|
|
|
export function roleNames(roles: { name: string }[]) {
|
|
return roles.map((role) => role.name).join("、") || "未分配角色";
|
|
}
|