!39 fix(utils): 补充缺失的getDateByPicker函数

* fix(utils): 补充缺失的getDateByPicker函数
* refactor(user): 移除未使用的UserQuitModal组件
This commit is contained in:
new_new_new
2026-06-15 07:01:41 +00:00
parent 4d9b66170a
commit 413bba6f19
2 changed files with 638 additions and 0 deletions
+20
View File
@@ -632,3 +632,23 @@ export const split = (str) => {
}
return str;
};
export function getDateByPicker(value: any, picker: string) {
if (!value) return value;
if (typeof value === 'string') return value;
if (value && typeof value.format === 'function') {
switch (picker) {
case 'date':
return value.format('YYYY-MM-DD');
case 'month':
return value.format('YYYY-MM');
case 'datetime':
return value.format('YYYY-MM-DD HH:mm:ss');
case 'time':
return value.format('HH:mm:ss');
default:
return value.format(picker);
}
}
return value;
}