Skip to content

Conversation

@abeckDev
Copy link
Owner

@abeckDev abeckDev commented Nov 6, 2025

This pull request updates the handling and documentation of date and time parameters for station board and train connection queries, ensuring time inputs and internal processing consistently use German local time instead of UTC. The main changes improve both user-facing documentation and backend logic to avoid confusion and potential errors related to time zones.

Time zone handling improvements:

  • In TimeTableService.cs, the logic for determining the effective time now checks if a date is provided and uses it directly (assuming German time). If not provided, it converts the current UTC time to German local time (Europe/Berlin), with a fallback to local system time if the timezone is not found or invalid. ([AbeckDev.DbTimetable.Mcp/Services/TimeTableService.csL51-R76](https://github.com/abeckDev/DB-TimetableAPI-MCPServer/pull/12/files#diff-a95998e7d0d552b4b7817fc93dba4f27d029847f4b0eff4cadf1dc1876b17308L51-R76))

Documentation updates:

  • In Tools.cs, the descriptions for the dateTime parameter in both GetStationBoard and FindTrainConnections methods have been updated to specify "German Time" instead of "UTC" to clarify expected input format for users. ([[1]](https://github.com/abeckDev/DB-TimetableAPI-MCPServer/pull/12/files#diff-ddb8e104d23f7d1eb044fc2272c33ada96451c3b77e2f7fbc8fe54bf1e10003aL49-R49), [[2]](https://github.com/abeckDev/DB-TimetableAPI-MCPServer/pull/12/files#diff-ddb8e104d23f7d1eb044fc2272c33ada96451c3b77e2f7fbc8fe54bf1e10003aL122-R122))

@abeckDev abeckDev requested a review from Copilot November 6, 2025 14:59
@abeckDev abeckDev self-assigned this Nov 6, 2025
@codecov
Copy link

codecov bot commented Nov 6, 2025

Codecov Report

❌ Patch coverage is 53.84615% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.07%. Comparing base (1cdd7b0) to head (200ed86).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...ckDev.DbTimetable.Mcp/Services/TimeTableService.cs 53.84% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #12      +/-   ##
==========================================
- Coverage   76.11%   75.07%   -1.04%     
==========================================
  Files           5        5              
  Lines         314      325      +11     
  Branches       56       55       -1     
==========================================
+ Hits          239      244       +5     
- Misses         46       52       +6     
  Partials       29       29              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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 updates the timezone handling for date/time parameters in the Deutsche Bahn Timetable API integration. The changes clarify that user-provided timestamps should be in German Time (Europe/Berlin) rather than UTC, and implements automatic timezone conversion when no datetime is provided.

  • Updated API documentation to specify "German Time" instead of "UTC" for datetime parameters
  • Implemented timezone-aware default time handling that converts UTC to German Time (Europe/Berlin)
  • Added fallback logic to handle timezone exceptions

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
AbeckDev.DbTimetable.Mcp/Tools.cs Updated parameter descriptions for GetStationBoard and FindTrainConnections to indicate German Time instead of UTC
AbeckDev.DbTimetable.Mcp/Services/TimeTableService.cs Implemented timezone conversion logic in GetStationBoardAsync to use Europe/Berlin timezone when no date is provided

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

@abeckDev
Copy link
Owner Author

abeckDev commented Nov 6, 2025

@copilot implement testing for the added timezone logic. Check the correct parsing of input dates and the fallback to the auto generated ones.

Copy link
Contributor

Copilot AI commented Nov 6, 2025

@abeckDev I've opened a new pull request, #13, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits November 6, 2025 15:07
Co-authored-by: abeckDev <8720854+abeckDev@users.noreply.github.com>
Add comprehensive tests for timezone handling in station board queries
@abeckDev abeckDev merged commit 25554fd into main Nov 6, 2025
2 of 4 checks passed
@abeckDev abeckDev deleted the feature/removeUtcTimezone branch November 6, 2025 15: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.

2 participants