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

Keep time zone information when creating widget #2452

Merged
merged 1 commit into from Jul 5, 2016

Conversation

Projects
None yet
2 participants
@edmundoa
Member

edmundoa commented Jul 4, 2016

Absolute time ranges in widgets were getting converted into ES_DATE_FORMAT, which converts the time into UTC, but loses the time zone information from the string representation. As AbsoluteRange.create() parses the date time and tries to keep the time zone information, that resulted in UTC times being converted into local time.

To fix the problem we avoid using ES_DATE_FORMAT, and use ISO8601 instead.

Fixes #2428

Keep time zone information when creating widget
Absolute time ranges in widgets were getting converted into
ES_DATE_FORMAT, which converts the time into UTC, but loses the time
zone information from the string representation. As the AbsoluteRange
create method parses the date time and tries to keep the time zone
information, that resulted in UTC times being converted into local time.

To fix the problem we avoid using ES_DATE_FORMAT, and use ISO8601
instead.

Fixes #2428

@edmundoa edmundoa added this to the 2.1.0 milestone Jul 4, 2016

@joschi joschi self-assigned this Jul 5, 2016

@joschi

This comment has been minimized.

Contributor

joschi commented Jul 5, 2016

@edmundoa How does this change affect existing widgets without the timezone information in their configuration?

@edmundoa

This comment has been minimized.

Member

edmundoa commented Jul 5, 2016

@joschi In my tests the change didn't affect existing widgets, because even when we removed the time zone in TimeRangeFactory, the stored date times still included time zone information in MongoDB (which is added by AbsoluteRange.parseDateTime()).

@joschi

This comment has been minimized.

Contributor

joschi commented Jul 5, 2016

LGTM. 👍

@joschi joschi merged commit d43932b into master Jul 5, 2016

4 checks passed

ci-server-integration Jenkins build graylog2-server-integration-pr 1062 has succeeded
Details
ci-web-linter Jenkins build graylog-pr-linter-check 548 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@joschi joschi deleted the issue-2428 branch Jul 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment