LightningFlowComponents
LightningFlowComponents copied to clipboard
Datatable - Search - Timezones and user display format are not respected when searching datetime fields
Steps to reproduce
Steps to reproduce the behavior:
- Configure Salesforce user with Timezone = GMT+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.
- Create a second record for the same object with any other value in the selected datetime field.
- Create flow with datatable component (search bar enabled) that shows the above record with the datetime field
- 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