Skip to content
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

Optimization - consistent date formats #6385

Merged
merged 2 commits into from
Nov 11, 2019
Merged

Optimization - consistent date formats #6385

merged 2 commits into from
Nov 11, 2019

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Nov 7, 2019

Overview > Optimization,
in the show_list views (/optimization/show_list and /optimization/show_list/123), we convert iso dates to the user representation in JS.

But, for saved report views (both in Optimization and in Reports), we use the formatted value provided by the API (/api/results/20892?expand_value_format=true&hash_attribute=result_set).

Before, the show_list value was formatted as "07/22/2019 9:44:50 am", in browser-local timezone.
Now, the show_list value is formatted as "07/22/2019 09:44:50 UTC", in the timezone set in user settings.

after

This also exposes the current user timezone (session[:user_tz]) to JS (ManageIQ.timezone), in the Europe/London / Etc/UTC... format.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1769333

the ruby ui code is using `session[:user_tz]` for timezone conversions,
providing the same value to JS world.

Except rails time zone names are non-standard, so converting to the Etc/UTC, America/New_York, ... format.
@himdel himdel modified the milestone: Sprint 124 Ending Nov 11, 2019 Nov 7, 2019
This makes sure that Optimization lists convert time to 24h, with time zone,
the same format that's coming from /api/results/20892?expand_value_format=true&hash_attribute=result_set

Previously, we would output show_list dates in the browser-local timezone, in 12h + am/pm format,
now, we output all the dates in user-set timezone, 24h, including the timezone abbreviation.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1769333
@miq-bot
Copy link
Member

miq-bot commented Nov 7, 2019

Checked commits https://github.com/himdel/manageiq-ui-classic/compare/a9fe50e60ea9cc2400a23494c326f9ceea7646e7~...7e83f20044f307782764cc62a66295229c81cbec with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. ⭐

@mzazrivec mzazrivec self-assigned this Nov 11, 2019
@mzazrivec mzazrivec added this to the Sprint 124 Ending Nov 11, 2019 milestone Nov 11, 2019
@mzazrivec mzazrivec merged commit 990e558 into ManageIQ:master Nov 11, 2019
@himdel himdel deleted the bz1769333 branch November 11, 2019 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants