feat: 前端UI标题栏优化与配置更新

- 更新.gitignore,添加frontend/.next/忽略
- 优化RecordModal、index、recurring、search、stats页面标题栏样式
- 新增frontend/lib/utils.js工具函数
- 更新useCategories.js钩子
- 添加代码优化计划文档

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Developer
2026-03-18 16:33:29 +08:00
co-authored by Claude
parent ad6387e49e
commit 127f491167
9 changed files with 2350 additions and 48 deletions
+28
View File
@@ -0,0 +1,28 @@
// Date utilities
export const getMonthStr = (date) =>
`${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}`;
export const formatMonth = (date) =>
`${date.getFullYear()}${date.getMonth() + 1}`;
export const formatMoney = (num) => (num || 0).toFixed(2);
// Parse date-time string 'YYYY-MM-DD HH:MM' into date and time parts
export const parseDateTime = (dateTimeStr) => {
if (!dateTimeStr) return { datePart: '', timePart: '00:00' };
const [datePart, timePart] = dateTimeStr.split(' ');
return { datePart, timePart: timePart || '00:00' };
};
// Extract date part from 'YYYY-MM-DD HH:MM'
export const getDatePart = (dateTimeStr) => {
if (!dateTimeStr) return '';
return dateTimeStr.split(' ')[0];
};
// Transaction type constants
export const TRANSACTION_TYPES = {
EXPENSE: 'expense',
INCOME: 'income',
ALL: 'all',
};