-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: useSearchableViewportData - support non-text filters #2092
feat: useSearchableViewportData - support non-text filters #2092
Conversation
6769152
to
6bc514b
Compare
@@ -1825,6 +1887,11 @@ export class TableUtils { | |||
dh.LongWrapper.ofString(TableUtils.removeCommas(value)) | |||
); | |||
} | |||
if (TableUtils.isDateType(type)) { | |||
return dh.FilterValue.ofNumber( | |||
DateUtils.trimDateTimeStringTimeZone(value) as unknown as number |
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.
Does this actually work? I wouldn't expect a date String
to work being passed into ofNumber
(just looking at the code).
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.
I think I had based this on the fact that this if check wasn't there before and the fallthrough case is just passing to dh.FilterValue.ofNumber
. The code I added was simply to trim the date string and no longer strip commas
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.
hmm, Looks like maybe this function doesn't actually get called on Date columns which would explain why it works
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.
I removed that block of code since it's never actually hit
resolves #2091
BREAKING CHANGE:
useSearchableViewportData
to be more consistent withuseViewportData
.usePickerWithSelectedValues
now requirestimeZone
.createSearchTextFilter
requirestimeZone