-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/remove utc timezone #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…vided date and improve timezone management
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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.
|
@copilot implement testing for the added timezone logic. Check the correct parsing of input dates and the fallback to the auto generated ones. |
Co-authored-by: abeckDev <8720854+abeckDev@users.noreply.github.com>
Add comprehensive tests for timezone handling in station board queries
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:
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:
Tools.cs, the descriptions for thedateTimeparameter in bothGetStationBoardandFindTrainConnectionsmethods 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))