Fix Time Manager filter ignoring configured attribute resolution (#7056) - #7057
Open
meyerlor wants to merge 2 commits into
Open
Fix Time Manager filter ignoring configured attribute resolution (#7056)#7057meyerlor wants to merge 2 commits into
meyerlor wants to merge 2 commits into
Conversation
…z#7056) The filter datetime format was hardcoded to day precision, truncating sub-day resolutions (minutes, hours, seconds) to date-only. This returned no features for non-midnight timestamps. Use the layer's configured attributeResolution when formatting the filter, clamping only months/years to days so that year-only ('1928') and month-only ('2020-06') strings are still avoided for DATE-typed fields in QGIS Server (3liz#6571).
Collaborator
|
@meyerlor can you add a test ? |
Extract the datetime format map and the filter resolution clamp into a pure, importable helper (modules/utils/TimeManagerFilter.js) so they can be unit tested without the moment/jQuery globals of the legacy module. buildDateFilter and formatDatetime now delegate to the helper; behaviour is unchanged. Tests cover that sub-day resolutions keep their time of day (3liz#7056) and that months/years are clamped to a full ISO date so no year-only or month-only string is emitted for DATE fields (3liz#6571).
Collaborator
Author
|
@rldhont are JS unit tests fine or do you prefere full e2e? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The filter datetime format was hardcoded to day precision, truncating sub-day resolutions (minutes, hours, seconds) to date-only. This returned no features for non-midnight timestamps.
Use the layer's configured attributeResolution when formatting the filter, clamping only months/years to days so that year-only ('1928') and month-only ('2020-06') strings are still avoided for DATE-typed fields in QGIS Server (#6571).
Fixes #7056