Closed pranshugupta54 closed 1 month ago
We have these basic policies to make the approval process smoother for our volunteer team.
Please make sure your code passes all tests. Our test code coverage system will fail if either of these two conditions occur:
The process helps maintain the overall reliability of the code base and is a prerequisite for getting your PR approved. Assigned reviewers regularly review the PR queue and tend to focus on PRs that are passing.
Do not assign reviewers. Our Queue Monitors will review your PR and assign them. When your PR has been assigned reviewers contact them to get your code reviewed and approved via:
Your reviewer(s) will have the following roles:
:dart: Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise.
The changes in this pull request focus on enhancing error handling in the lib/utils/time_conversion.dart
file. Specifically, the splitDateTimeUTC
, splitDateTimeLocal
, convertUTCToLocal
, and convertLocalToUTC
functions have been updated to include try-catch
blocks for managing exceptions during date and time parsing. In the event of an error, these functions will print an error message and return an empty map or string. Additionally, the documentation for these functions has been revised to clarify their return values when invalid inputs are encountered.
File Path | Change Summary |
---|---|
lib/utils/time_conversion.dart | Added error handling with try-catch blocks to splitDateTimeUTC , splitDateTimeLocal , convertUTCToLocal , and convertLocalToUTC . Updated documentation comments to specify return values for invalid inputs. |
test/widget_tests/.../time_conversion_test.dart | Added new test cases for error handling in splitDateTimeUTC , splitDateTimeLocal , convertUTCToLocal , and convertLocalToUTC . Included tests for handling invalid datetime strings. |
Objective | Addressed | Explanation |
---|---|---|
Implement middleware to convert UTC to local time | β | The changes do not implement middleware as requested. |
Implement middleware to convert local to UTC time | β | The changes do not implement middleware as requested. |
lib/utils/time_conversion.dart
file, specifically the splitDateTimeUTC
, splitDateTimeLocal
, convertUTCToLocal
, and convertLocalToUTC
functions, which are also updated in the main PR to include error handling. Both PRs are focused on enhancing the functionality and robustness of time conversion methods.π In the meadow, time does play,
With error handling brightening the way.
UTC and local, they dance and twirl,
In maps and strings, they spin and swirl.
So hop along, dear friends, donβt delay,
For time's a treasure, come what may! πΌ
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 96.48%. Comparing base (
bfda1a5
) to head (b99c323
). Report is 1 commits behind head on develop.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
What kind of change does this PR introduce?
Try catch for conversions
Issue Number:
Fixes #2558
Did you add tests for your changes?
NA
Snapshots/Videos:
NA
If relevant, did you update the documentation?
NA
Summary
This PR adds extra checks for conversions.
Does this PR introduce a breaking change?
No
Other information
NA
Have you read the contributing guide?
Summary by CodeRabbit
Bug Fixes
Documentation
Tests