freshworks / crayons

🖍️ Crayons - A UI Kit comprising of web components for building Freshworks Apps!
https://crayons.freshworks.com
219 stars 61 forks source link

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

Closed harshith-venkatesh-freshworks closed 1 year ago

harshith-venkatesh-freshworks commented 1 year ago

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 commented 1 year ago

@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 commented 1 year ago

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