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

Fix: Details Visualization: render date/time values as strings and not epoch time #3951

Merged
merged 1 commit into from
Jul 4, 2019

Conversation

arikfr
Copy link
Member

@arikfr arikfr commented Jul 4, 2019

What type of PR is this? (check all applicable)

  • Bug Fix

Description

Because we were just converting values to strings ('' + value) date/time values were rendered as epoch times:

image

This Pull Request fixes this by properly converting them using the system settings date/time format.

There is some logic duplication here with the Table visualization, which we should remove in the future.

Copy link
Collaborator

@kravets-levko kravets-levko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 I left a comment, but it's not a blocker. I think, the next level will be an editor similar to Table's one - where user can manually choose how to display each column

};

if (type === 'date' || type === 'datetime') {
if (moment.isMoment(value)) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if (moment.isMoment(value)) { is enough, previous if is almost useless.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's relevant to make sure we have a known format type. But it's true that it will only be a moment if it's one of those (in normal situations).

@arikfr
Copy link
Member Author

arikfr commented Jul 4, 2019

I think, the next level will be an editor similar to Table's one - where user can manually choose how to display each column

I agree. I think it will make sense to reuse parts of the Table editor and rendering here, we can look into this when migrating the Table editor. Although wouldn't want to delay it because of this.

@arikfr arikfr merged commit 5e5b56e into master Jul 4, 2019
@arikfr arikfr deleted the fix-details-dates branch July 4, 2019 17: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.

2 participants