Skip to content
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

[Bug] - The value displayed in the filter component for Date with inBetween condition coming as [Object Object] #865

Closed
harshith-venkatesh-freshworks opened this issue Jun 5, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@harshith-venkatesh-freshworks
Copy link
Contributor

Component
The name of the component

import { FwPlatformTable, FwFilter } from '@freshworks/crayons-custom-objects/react';
"@freshworks/crayons-custom-objects": "^1.3.0-beta.15",

Describe the bug
A clear and concise description of the issue.

When we select the range of the Date, and add it to the filter, we end up getting the fromDate and toDate Object which is being used as parameters as well, however it is not being shown same as the value here.
The behaviour is being repeated in case of change of range as well.
Most of the time, we are observing this error

On change of date range in filter, this is being observed.
"01 Jun 2023 to 03 Jun 2023" is the value being passed which leads to an issue over this function.

// If ISO format, format it to display format and validate
let [fromDate, toDate] = (value === null || value === void 0 ? void 0 : value.split(TranslationController.t('datepicker.to'))) || [];
fromDate = fromDate === null || fromDate === void 0 ? void 0 : fromDate.trim();
toDate = toDate === null || toDate === void 0 ? void 0 : toDate.trim();

Invalid date provided ! TypeError: e.split is not a function
    at n.value (datepicker.js:1750:89)
    at index.js:1906:38
    at Array.map (<anonymous>)
    at en (index.js:1903:34)
    at n.set [as value] (index.js:1965:25)
    at mt (index.js:604:29)
    at gt (index.js:666:9)
    at St (index.js:978:17)
    at Nt (index.js:861:13)
    at St (index.js:983:13)

To Reproduce
Steps to reproduce the current behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what is expected to happen.

Screenshots
Screenshot 2023-06-05 at 4 27 33 PM
Screenshot 2023-06-05 at 4 27 38 PM
Screenshot 2023-06-05 at 4 27 51 PM
Screenshot 2023-06-05 at 4 29 16 PM

Additional context
Add any other context about the bug here.

@arvindanta
Copy link
Collaborator

@harshith-venkatesh-freshworks Has this been fixed ?. Can you please confirm and close this issue if it has been fixed and released.

@harshith-venkatesh-freshworks
Copy link
Contributor Author

Thanks team for quickly prioritizing this issue and helping with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants