Skip to content

Commit

Permalink
fixed marshall fast search datetime-local values
Browse files Browse the repository at this point in the history
  • Loading branch information
mmadariaga committed May 28, 2024
1 parent e0e748b commit 7f3c5aa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion library/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@irontec/ivoz-ui",
"version": "1.3.11",
"version": "1.3.12",
"description": "UI library used in ivozprovider",
"license": "GPL-3.0",
"main": "index.js",
Expand Down
10 changes: 7 additions & 3 deletions library/src/components/List/Content/FastSearchField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ const FastSearchField = (
const fkChoices =
(foreignEntities[firstColumnName] as DropdownArrayChoices) || [];

const [value, setValue] = useState(firstColumnCriteria?.value || '');

const isDatetime = !isFk && firstColumnSpec.format === 'date-time';

const initialValue = (firstColumnCriteria?.value as string) || '';
const [value, setValue] = useState(
isDatetime ? initialValue.replace(' ', 'T') : initialValue
);

const triggerSearchIfChanged = () => {
if (!firstColumnCriteria) {
return;
Expand All @@ -60,7 +63,8 @@ const FastSearchField = (
}

if (value !== '') {
firstColumnCriteria.value = encodeURIComponent(value);
const val = isDatetime ? (value as string).replace('T', ' ') : value;
firstColumnCriteria.value = encodeURIComponent(val);
}

let match = false;
Expand Down

0 comments on commit 7f3c5aa

Please sign in to comment.