-
Notifications
You must be signed in to change notification settings - Fork 25.7k
DateMath: Use time zone when rounding. #9885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Currently rounding in DateMathParser is always done in UTC, even when another time zone is specified. This fix corrects this by passing the specified time zone down to the rounding logic. Closes elastic#9814
|
LGTM |
|
On 1.x with 8391b51. @rjernst I ran into a bit of a mess trying to backport the tests in DateMathParserTests for this PR to the 1.4 branch. The diff between the two branches is quiet big for that test class, so adding just the new lines for this fix is difficult. I tried backporting the the whole test class form 1.x to 1.4, but in that case I had to change a lot of the actual tests to the current behaviour of DateMath on 1.4. |
|
If the backport is too complicated, we should not do it. I don't think this is critical enough that it must be in a bugfix release. |
|
@rjernst The backport is not difficult, would be nice to have on 1.4. Just the test class changed a lot from 1.4 to 1.x, so the tests will have to be adapted and be slightly different from this PR. Would you mind having another look if I push to my repo before merging? |
|
@cbuescher Sure, let me know where to look. |
|
I pushed the changes agains 1.4 branch to cbuescher@997b8ce. Basically it's the same fix as in 1.x, I only backportet the rounding tests and had to adapt them to the "old" rounding logic on 1.4. (I think you changed the edge inclusions on the 1.x branch) |
|
@cbuescher +1 to the backport |
|
Great, pushed to 1.4 branch with dff19cb |
Currently rounding in DateMathParser This always done in UTC, even when another time zone is specified. This is fixed by passing the time zone down to the rounding logic when it is specified. Closes elastic#9814 Closes elastic#9885
Currently rounding in DateMathParser is always done in UTC, even
when another time zone is specified. This is fixed by passing the time zone
down to the rounding logic when it is specified.
Closes #9814