Skip to content

Commit

Permalink
Fix custom attribute date time picker in filters (#791)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbbyB97 authored Aug 30, 2024
1 parent a6aa4bf commit 47aad32
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/components/FilterWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -480,28 +480,6 @@ export default function FilterWidget({ onFilterUpdate, title, entity, getAvailab
}
value={filterValue?.toString() || ''}
onChange={(e) => {
if (
(currentField?.attributeContentType && checkIfFieldAttributeTypeIsDate(currentField)) ||
(currentField?.type && checkIfFieldTypeIsDate(currentField?.type))
) {
if (
currentField?.attributeContentType === AttributeContentType.Date ||
currentField?.type === FilterFieldType.Date
) {
const dateVal = getFormattedDate(e.target.value);
setFilterValue(JSON.parse(JSON.stringify(dateVal)));
return;
}
if (
currentField?.attributeContentType === AttributeContentType.Datetime ||
currentField?.type === FilterFieldType.Datetime
) {
const dateTimeVal = getFormattedDateTime(e.target.value);
setFilterValue(JSON.parse(JSON.stringify(dateTimeVal)));
return;
}
return;
}
setFilterValue(JSON.parse(JSON.stringify(e.target.value)));
}}
placeholder="Enter filter value"
Expand Down

0 comments on commit 47aad32

Please sign in to comment.