feat: 新增持有天数

This commit is contained in:
hzm
2026-03-22 14:52:29 +08:00
parent 303071f639
commit 84a720164c
6 changed files with 181 additions and 12 deletions

View File

@@ -794,6 +794,9 @@ export default function HomePage() {
const holdingAmount =
amount == null ? '未设置' : `¥${amount.toFixed(2)}`;
const holdingAmountValue = amount;
const holdingDaysValue = holding?.firstPurchaseDate
? dayjs.tz(todayStr, TZ).diff(dayjs.tz(holding.firstPurchaseDate, TZ), 'day')
: null;
const profitToday = profit ? profit.profitToday : null;
const todayProfit =
@@ -869,6 +872,7 @@ export default function HomePage() {
estimateProfitPercent,
holdingAmount,
holdingAmountValue,
holdingDaysValue,
todayProfit,
todayProfitPercent,
todayProfitValue,