feat: 新增汇率管理页面,支持净资产历史趋势、货币转换,并引入交易相关组件和预算页面
This commit is contained in:
@@ -178,7 +178,7 @@ export async function updateTransaction(
|
||||
if (data.transactionDate !== undefined) payload.transaction_date = data.transactionDate;
|
||||
if (data.note !== undefined) payload.note = data.note;
|
||||
if (data.tagIds !== undefined) payload.tag_ids = data.tagIds;
|
||||
|
||||
|
||||
const response = await api.put<ApiResponse<Transaction>>(`/transactions/${id}`, payload);
|
||||
if (!response.data) {
|
||||
throw new Error(response.error || 'Failed to update transaction');
|
||||
@@ -209,7 +209,14 @@ export function groupTransactionsByDate(transactions: Transaction[] | undefined)
|
||||
if (!dateValue) {
|
||||
continue; // Skip transactions without a date
|
||||
}
|
||||
const date = dateValue.split('T')[0];
|
||||
|
||||
// Fix: Use local time for grouping instead of UTC string split
|
||||
const d = new Date(dateValue);
|
||||
const year = d.getFullYear();
|
||||
const month = String(d.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(d.getDate()).padStart(2, '0');
|
||||
const date = `${year}-${month}-${day}`;
|
||||
|
||||
const existing = groups.get(date) || [];
|
||||
existing.push(transaction);
|
||||
groups.set(date, existing);
|
||||
|
||||
Reference in New Issue
Block a user