banana icon indicating copy to clipboard operation
banana copied to clipboard

Timepicker UTC

Open rdurham1007 opened this issue 10 years ago • 3 comments

Up until this commit 6 months ago:

https://github.com/LucidWorks/banana/commit/1701a62a58048654e086d642ac259533fa6fedae

In the timepicker module the function time_calc() was using moment.utc when getting the date from the time picker control. There are actually still comments in there saying that moment.utc actually fixes some previous bugs. However this was changed six months ago and is actually causing an issue since all of my solr times are stored UTC. When time_cal goes to calculate the to and from the times are incorrect because it is no longer converting to UTC.

Was this just an oversight or was it a purposeful change?

rdurham1007 avatar Jun 26 '15 18:06 rdurham1007

Currently, timepicker module entered time is considered local time. While Solr stores UTC time only, timepicker time is converted to UTC before issuing the query. All panels, i.e. table, filters, ... should display UTC. Hope this makes sense,

aadel avatar Jun 28 '15 16:06 aadel

Right, that's what I thought it was supposed to be. However, in the change that i mentioned someone took out the .utc() function call so that when time_apply is called it uses the time as is rather than trying to convert it to utc.

rdurham1007 avatar Jun 28 '15 23:06 rdurham1007

Actually, UTC conversion is done at the filter service via toISOString() calls which converts local time to UTC, for example lines 163 and 169 before being sent as fq's. What was happening before this commit is double conversion which caused time to keep shifting issue.

aadel avatar Jun 29 '15 14:06 aadel