Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to the
ooui/graph/timerange.py
file and its associated test suite to enhance date handling and add support for weekly time ranges. The most important changes include the addition of a new helper function for date parsing, modifications to existing functions to utilize this helper, and updates to the test suite to cover the new functionality.Improvements to date handling:
ooui/helpers/dates.py
: Added a new helper functiondatetime_from_string
to handle various date formats, including weekly dates.ooui/graph/timerange.py
: Updated functionsget_missing_consecutive_dates
,convert_date_to_time_range_adjusted
, andcheck_dates_consecutive
to use the newdatetime_from_string
helper function for parsing dates. [1] [2] [3]Support for weekly time ranges:
ooui/graph/timerange.py
: Modified theget_date_format
function to return the correct format string for weekly dates.spec/graph/timerange_spec.py
: Added new test cases to verify the handling of weekly time ranges inget_missing_consecutive_dates
,fill_gaps_in_timerange_data
, andprocess_timerange_data
. [1] [2] [3]Related