LightningFlowComponents icon indicating copy to clipboard operation
LightningFlowComponents copied to clipboard

Datatable - Search - Timezones and user display format are not respected when searching datetime fields

Open smunkelt opened this issue 1 year ago • 0 comments

Steps to reproduce

Steps to reproduce the behavior:

  1. Configure Salesforce user with Timezone = GMT+2
  2. Create Work Order record with StartDate = any day, time = 01:00 AM It can also be any other object with an editable datetime field.
  3. Create a second record for the same object with any other value in the selected datetime field.
  4. Create flow with datatable component (search bar enabled) that shows the above record with the datetime field
  5. Enter date that is displayed in the datatable component search bar

Expected behaviour

  • Enter a search term (using display format = dd/mm/yyyy) identical to what is displayed in the datatable component (screenshot 1). The component will display the record that matches the search term.
  • Enter a search term (using display format of DB = yyyy-mm-dd). The component will display the record that matches the search term.

Actual behaviour

  • The search of a datetime field is not respecting the display format on the UI (screenshot 2&3)
  • Search string needs to be identical to how the date is saved in the database (yyyy-mm-dd) (screenshot 5)
  • Search logic is not respecting timezone differences when the displayed datetime on UI is already the next day but the UTC datetime is still the previous day (screenshot 4).
  • For the example in the screenshot. Value stored in the database (in UTC) = 2024-04-13T23:00:00

Screenshots

image

smunkelt avatar Jul 16 '24 15:07 smunkelt