hookehuyr

fix(FeedbackList): 修复日期格式显示问题,改用12小时制并添加上午/下午标识

......@@ -178,13 +178,19 @@ const loadMore = () => {
const formatDate = (dateString) => {
if (!dateString) return '';
const date = new Date(dateString);
return date.toLocaleString('zh-CN', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
hour: '2-digit',
minute: '2-digit'
});
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
const hours = date.getHours();
const minutes = String(date.getMinutes()).padStart(2, '0');
// 判断上午下午
const period = hours < 12 ? '上午' : '下午';
// 转换为12小时制
const displayHours = String(hours % 12 || 12).padStart(2, '0');
return `${year}-${month}-${day} ${period}${displayHours}:${minutes}`;
};
/**
......