sinequa / sba-angular

Sinequa's Angular-based Search Based Application (SBA) Framework
https://sinequa.github.io/sba-angular/
MIT License
30 stars 23 forks source link

Issue in recent queries dates #115

Closed Guillaume-Developer closed 6 months ago

Guillaume-Developer commented 8 months ago

Hi, I've recently noticed an issue in the recent queries ordering. When looking at the user settings file, I could find that for every search I do, all my recent-queries are being updated with currentDateTime+9h. Tracking down the cause of the issue, I realized that it came from a change performed 23 month ago in this commit 74e007d4b788df1e48abbe65e93267506b241c6f. I think the commit was aiming to reverse some changes that removed the UTC to current time zone conversion, however it only added the conversion of program to file and didn't add the conversion file to program. Hence, whenever we perform a search, all recent-queries are updated with currentDateTime+timezoneTimeDifference.

The fix to this is to modify the line 66 from

rq.date = new Date(rq.date); 

to

const date = Utils.toDate(rq.date);
if (date) {
    rq.date = date;
}
hebus commented 6 months ago

Hello, when I look at line 66, I already see your proposition

const date = Utils.toDate(rq.date);
if (date) {
    rq.date = date;
}