Skip to content

fix(common): support single-day term event parsing in GetTermEvents#55

Merged
Seeridia merged 1 commit intomainfrom
fix/jwch-term-events-single-day-parse
Feb 6, 2026
Merged

fix(common): support single-day term event parsing in GetTermEvents#55
Seeridia merged 1 commit intomainfrom
fix/jwch-term-events-single-day-parse

Conversation

@Seeridia
Copy link
Member

@Seeridia Seeridia commented Feb 6, 2026

支持校历中单日日程的解析

附:现在的被解析文本

2025-09-01至2025-09-07为学生补考;  2025-09-06至2025-09-07为新生报到;  2025-09-07为学生注册;  2025-09-08为正式上课;  2025-09-08至2025-09-21为新生军训;  2025-09-29为新生上课;  2025-11-13至2025-11-15为校运会;  2026-01-24至2026-01-30为期末考试;  2026-01-31至2026-03-01为寒假;  

@Seeridia Seeridia requested a review from renbaoshuo as a code owner February 6, 2026 10:34
Copilot AI review requested due to automatic review settings February 6, 2026 10:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the calendar event parsing logic in GetTermEvents to properly support single-day events in addition to date range events. Previously, events without a date range (no "至" separator) were treated as malformed data and stored with only the event name. Now, single-day events like "2025-09-07为学生注册" are properly parsed and stored with both StartDate and EndDate set to the same date.

Changes:

  • Added validation to handle events without "为" separator before attempting to parse dates
  • Enhanced name parsing to handle event names containing "为" by joining all parts after the first "为"
  • Changed single-date event handling from treating them as malformed to properly parsing them as single-day events

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Seeridia Seeridia merged commit fd2566b into main Feb 6, 2026
10 checks passed
@Seeridia Seeridia deleted the fix/jwch-term-events-single-day-parse branch February 6, 2026 12:19
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