feat(M08-B): 建立保洁管理后台
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
export function money(cents: number) {
|
||||
return `¥${(Number(cents || 0) / 100).toFixed(2)}`;
|
||||
}
|
||||
|
||||
export function shortDate(value?: string | null) {
|
||||
if (!value) return '-';
|
||||
const date = new Date(value);
|
||||
if (Number.isNaN(date.getTime())) return '-';
|
||||
return date.toLocaleString('zh-CN', {
|
||||
month: '2-digit',
|
||||
day: '2-digit',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit'
|
||||
});
|
||||
}
|
||||
|
||||
export function compactText(value?: string | null) {
|
||||
return value && value.trim().length > 0 ? value : '-';
|
||||
}
|
||||
Reference in New Issue
Block a user