Skip to content
Snippets Groups Projects
Commit d2e1a1de authored by Adrien Dieudonne's avatar Adrien Dieudonne
Browse files

[FIX] web: search_filters: need to convert datetime to utc

When a datetime was selected in a search filter, the time wasn't
converted to UTC to the server.
So, there were unexpecting records due to the wrong query domain.

When we retrieve the value from the datepicker, we need to convert
it to UTC before sending it to the server.
parent 09236d0e
No related branches found
No related tags found
No related merge requests found
......@@ -187,7 +187,10 @@ ExtendedSearchProposition.DateTime = ExtendedSearchProposition.Field.extend({
{value: "", text: _lt("is not set")}
],
get_value: function (index) {
return this["datewidget_" + (index || 0)].getValue();
// retrieve the datepicker value
var value = this["datewidget_" + (index || 0)].getValue();
// convert to utc
return value.add(-this.getSession().getTZOffset(value), 'minutes');
},
get_domain: function (field, operator) {
switch (operator.value) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment