elasticsuite
elasticsuite copied to clipboard
Search Usage Analytics - Can't select date range
Preconditions
- Admin user with "Interface Locale" set to "English (United Kingdom)"
Magento Version : 2.3.5-p2
ElasticSuite Version: 2.9.3
Environment: Production
Steps to reproduce
- Go to
Elasticsuite > Search Usage
- Choose a date range
- Press "Apply"
Expected result
- Shows results for selected date range
Actual result
- Date range changes to a random date
Hello @vseager
I can't reproduce your bug. I tried with Magento EE 2.3.5-p2, all date ranges that I selected were added correctly.
Maybe you should try to clear the cache or check if there're any errors in the console log in Chrome/Firefox.
If this issue still exists please provide more details.
Best regards
Hi @vahonc ,
Thanks for checking, it looks like your dates are in US format (mm/dd/yy). Can you try switching your admin user locale to English (United Kingdom)
as mentioned in the preconditions?
@vahonc did you manage to reproduce this issue after changing the user locale?
Hi @vseager,
Yes, I was able to reproduce this issue but unfortunately didn't have time to investigate. Any ideas?
Best regards
@vahonc I haven't investigated it but I assume it's not taking into account the user's locale settings in their admin account.
Hello @vseager,
Yes historically, there were multiple issues with locales other than en_US with the date picker widget/form component. The problem you are described used to occur also on special price from/special price to product attributes, customer birthdates and lots of other native admin interfaces of Magento. I couldn't find a way to make our input fields work coherently with the locale, so I just gave up at some point back then ¯_(ツ)_/¯.
I'll try to find the issue again, but it may have been fixed as in a EE 2.3.5-p2 the behavior seems ok on the Content Staging screens or the customer birthdate attribute.
Best regards,
Edit: best guess https://github.com/magento/magento2/issues/6858 ? It's flagged as fixed since 2.3.0 (which is not consistent with the date of the 2.8.0 release with the search usage dashboard), but not totally sure it's fixed for every locale. See https://github.com/magento/magento2/issues/30382 and https://github.com/magento/magento2/issues/28801
Hello @vseager,
I agree with @rbayet. For my side, I want to add, I researched this problem and I can say with confidence that the date format changes in our code after changing the local interface for the Admin User from "M/d/yy" for en_US locale to "dd/MM/y" for en_GB locale. But I still could not find a solution to how to protect our fields from incomprehensible jumps that are clearly influenced by some kind of logic datepicker
Best regards,
@vahonc @rbayet We have also seen similar issues with date pickers in the past but have these were mostly resolved as from 2.3.5-p2
Hello @vseager,
Thanks for your feedback, I will check this issue on Magento ver. 2.4.1
Best regards,
So I've checked this issue on Magento ver. 2.4.1 and ElasticSuite 2.10.3,
Unfortunately, I don't have a lot of data for Search Usage statistics on my local environment, so I have data only from the begging of this month (from 3 Dec to 10 Dec). Looks like If "Interface Locale" set to "English (United States)" there is no date jumping if we click on the "Apply" button in the Date pickers widget. But if we change "Interface Locale" to "English (United Kingdom)" there is some weird date jumping for example FROM 3/12/2020 - 10/12/2020 and show some data - TO 12/4/2020 - 12/10/2020 - No any data, each time when I click on the "Apply" button.
I suppose there are still some bugs or strange behavior of the Date pickers widget. But to be sure I need more data from Search Usage Analytics. So @vseager could you tell me how things are with this problem on your side and whether it was solved? Is this still relevant for you and your environment?
Best regards,
@vahonc we haven't yet got any sites running 2.4.1 with Elasticsuite although will be upgrading a couple in the new year. From your findings though it looks like the issue is still there, as you state that when the locale is set to "English (United Kingdom)" you still get the jumping.
Hi,
We're using magento 2.4.2 and the issue is still there :S. I've tried to modify the code to see if I can make it work, but there are many conversions :S and couldn't do it.
Hi, I confirm there is still a problem.
With English (United States), everything seem to be okay.
But if you use Français (France) you'll run into issues.
I can reproduce the issue which is related to date format.
- Set your locale to Français (France).
- Go to Search Analytics.
- Filter on "05/12/2022" (05 december 2022) to "12/12/2022" (12 december 2022).
- You end up with results from "12/05/2022 (12 may 2022) to "12/12/2022 (12 december 2022)".
- All the ES queries processed to built the reports are using "2022-05-12" as the date so obviously not the good one.