Skip to content

fix(usage): make last-24-hours preset a true rolling window - #36

Merged
ziyue-hermes[bot] merged 3 commits into
mainfrom
codex/fix-rolling-24h-window
Aug 16, 2026
Merged

fix(usage): make last-24-hours preset a true rolling window#36
ziyue-hermes[bot] merged 3 commits into
mainfrom
codex/fix-rolling-24h-window

Conversation

@ziyue67

@ziyue67 ziyue67 commented Aug 16, 2026

Copy link
Copy Markdown
Owner

修复内容

  • 将用户使用记录、管理端使用记录和管理端仪表盘的“近 24 小时”预设改为真正的滚动 24 小时窗口。
  • 预设向后端传递带时区的 RFC3339 时间;后端在保持 YYYY-MM-DD 手选日期整天语义不变的前提下接受完整时间。
  • 统一三个视图的日期范围计算到 frontend/src/utils/dateRange.ts,避免重复逻辑再次漂移。

影响范围

修复临近午夜时将“昨天 + 今天”误算为接近 48 小时、以及跨零点后统计突变的问题。

来源

验证

  • go test -tags=unit ./internal/handler ./internal/handler/admin ./internal/pkg/timezone -count=1
  • pnpm exec vitest run src/components/common/__tests__/DateRangePicker.spec.ts src/views/admin/__tests__/DashboardView.spec.ts src/views/admin/__tests__/UsageView.spec.ts:3 个文件、11 个用例通过
  • 上游 fix(usage): make last-24-hours preset a true rolling window Wei-Shaw/sub2api#5698 的 CI 已全部通过。

Copilot AI lite review requested due to automatic review settings August 16, 2026 12:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ziyue67

ziyue67 commented Aug 16, 2026

Copy link
Copy Markdown
Owner Author

@Hermes cl全绿就合并别别告诉我 at我

@ziyue-hermes

ziyue-hermes Bot commented Aug 16, 2026

Copy link
Copy Markdown

✅ 收到指令,正在处理中,请稍候…

@ziyue-hermes
ziyue-hermes Bot merged commit b060008 into main Aug 16, 2026
14 checks passed
@ziyue-hermes
ziyue-hermes Bot deleted the codex/fix-rolling-24h-window branch August 16, 2026 13:20
@ziyue-hermes

ziyue-hermes Bot commented Aug 16, 2026

Copy link
Copy Markdown

✅ PR #36 已合并(squash,commit b0600087,分支已删)。

按你的要求不 @ 不打搅,完事。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants