Skip to content

fix: calculate track day from conference start date - #316

Open
Link1515 wants to merge 1 commit into
mainfrom
track-day
Open

fix: calculate track day from conference start date#316
Link1515 wants to merge 1 commit into
mainfrom
track-day

Conversation

@Link1515

@Link1515 Link1515 commented Aug 7, 2026

Copy link
Copy Markdown
Member

closes #315

Summary

修正僅在活動第二天有議程的 track,會被錯誤標示為「Day 1」的問題。Day 編號現在依 COSCUP 2026 的會期首日計算,而非依該 track 自身的日期列表排序。

Changes

  • 在 track 頁面定義會期首日 2026-08-08。
  • 以選取日期與會期首日的日曆差計算 Day 編號。
  • 保留未選取日期時顯示 Day 1 的既有預設行為。

Summary by CodeRabbit

  • Bug Fixes
    • Corrected conference day selection to align with the calendar date.
    • Defaults to the first conference day when no day is selected.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The track page now uses a fixed conference start date to calculate the selected calendar day. It returns day 1 when no day is selected.

Changes

Conference day index

Layer / File(s) Summary
Date-based day calculation
app/pages/track/[id].vue
The page defines CONFERENCE_START_DAY and calculates dayIndex with timezone-aware date arithmetic. Empty selections still return day 1.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

Possibly related PRs

  • COSCUP/2026#215 — Both PRs modify the day index calculation in app/pages/track/[id].vue.

Suggested reviewers: mirumodapon, pan93412

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: calculating the track day from the conference start date.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch track-day

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
app/pages/track/[id].vue (1)

113-119: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add regression tests for the day-index contract.

Cover 2026-08-08 → 1, 2026-08-09 → 2, and an empty selection → 1. These cases protect the fixed-date calculation and fallback behavior.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@app/pages/track/`[id].vue around lines 113 - 119, Add regression tests for
the day-index calculation used by the selectedDay logic, covering 2026-08-08
returning 1, 2026-08-09 returning 2, and an empty selection returning 1. Reuse
the existing test setup and target the component’s day-index behavior without
changing the implementation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@app/pages/track/`[id].vue:
- Around line 113-119: Add regression tests for the day-index calculation used
by the selectedDay logic, covering 2026-08-08 returning 1, 2026-08-09 returning
2, and an empty selection returning 1. Reuse the existing test setup and target
the component’s day-index behavior without changing the implementation.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: bf242105-cca4-400b-8ed6-6c8421499fa6

📥 Commits

Reviewing files that changed from the base of the PR and between 0d49932 and 8b837aa.

📒 Files selected for processing (1)
  • app/pages/track/[id].vue

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.

只有 Day 2 議程軌頁面會顯示 Day 1

3 participants