Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[WebProfilerBundle] Display date/time elements in the user local timezone #49012

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

Merged
merged 1 commit into from
Jan 19, 2023

Conversation

javiereguiluz
Copy link
Member

@javiereguiluz javiereguiluz commented Jan 17, 2023

Q A
Branch? 6.3
Bug fix? no
New feature? yes
Deprecations? no
Tickets -
License MIT
Doc PR -

On Symfony Slack, @tarlepp suggested to render all <time> elements in the user local timezone. I think it's a great idea, so this PR implements it.

A question remains: should we display date/times in the user timezone AND locale; or on their timezone BUT always in English, like the rest of the interface?

Some examples:

Main profile datetime

(I'm seeing it in Spanish; each developer will see it on their own language)

profiler-profile-datetime

Search results datetime

profiler-search-results-datetime

Logger timestamps

profiler-logs-datetime

@javiereguiluz javiereguiluz added this to the 6.3 milestone Jan 17, 2023
@javiereguiluz javiereguiluz changed the title [WebProfilerBundle] Display date/time elements in the user local time… [WebProfilerBundle] Display date/time elements in the user local timezone Jan 17, 2023
@tarlepp
Copy link
Contributor

tarlepp commented Jan 17, 2023

A question remains: should we display date/times in the user timezone AND locale; or on their timezone BUT always in English, like the rest of the interface?

What about making those as choice that user could change from profiler configuration? With that each user could choose how they want to show those.

@javiereguiluz
Copy link
Member Author

I'd prefer to not introduce a config option for that. I don't think it's important enough to require a customizable setting.

The entire interface is (and will remain) in English ... so maybe it's better to just use English for this too?

@fabpot
Copy link
Member

fabpot commented Jan 17, 2023

I would not make this configurable. Local time always in English sounds good enough to me.

@stof
Copy link
Member

stof commented Jan 17, 2023

I also vote for keeping it in English like other parts of the interface

};
})();

Sfjs.addEventListener(document, 'DOMContentLoaded', function() {
Sfjs.createTabs();
Sfjs.createToggles();
Sfjs.convertDateTimesToUserTimezone();
Copy link
Member

Choose a reason for hiding this comment

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

Should this code really be in the JS code that is also loaded by the toolbar ? If think we should have a separate JS file containing profiler-only JS logic (just like we already separate the CSS).

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. In a (near) future PR, I'm going to split this JS code and also modernize it a bit.

@javiereguiluz
Copy link
Member Author

I've updated this PR:

  • Dates/times now displayed always in English
  • The existing title attribute of <time> is no longer removed
  • The logger panel timestamps have millisecond precision again

@fabpot
Copy link
Member

fabpot commented Jan 19, 2023

Thank you @javiereguiluz.

@fabpot fabpot merged commit adbfcfa into symfony:6.3 Jan 19, 2023
@javiereguiluz javiereguiluz deleted the profiler_dates branch January 19, 2023 19:21
@fabpot fabpot mentioned this pull request May 1, 2023
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.

5 participants