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

Show local time in avatar menu #35979

Merged

Conversation

nickvergessen
Copy link
Member

Fix nextcloud/spreed#4657

Bildschirmfoto vom 2023-01-04 10-38-27

Checklist

Signed-off-by: Joas Schilling <coding@schilljs.com>
@nickvergessen nickvergessen added enhancement 3. to review Waiting for reviews labels Jan 4, 2023
@nickvergessen nickvergessen added this to the Nextcloud 26 milestone Jan 4, 2023
@nickvergessen nickvergessen requested review from vitormattos, Pytal and a team January 4, 2023 10:10
@nickvergessen nickvergessen self-assigned this Jan 4, 2023
@nickvergessen nickvergessen requested review from ArtificialOwl, icewind1991 and blizzz and removed request for a team January 4, 2023 10:10
if (!empty($targetUser)) {
$timezone = $this->config->getUserValue($targetUser->getUID(), 'core', 'timezone') ?: date_default_timezone_get();
$dateTimeZone = new \DateTimeZone($timezone);
$localTime = $this->dateTimeFormatter->formatTime($this->timeFactory->getDateTime(), 'short', $dateTimeZone);
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this be a live view in the frontend instead ?

we'd need to expose the time zone info instead and compute the time in the frontend (possible with the "moment" library)

Copy link
Member

Choose a reason for hiding this comment

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

I see that it's in the contacts menu, if the time is recomputed on every click on an avatar then it's accurate enough with the current solution

Copy link
Member Author

Choose a reason for hiding this comment

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

if the time is recomputed on every click on an avatar

Exactly that is the case

Copy link
Member Author

Choose a reason for hiding this comment

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

shouldn't this be a live view in the frontend instead ?

That would mean clients of the API would also need to do that. Would like to avoid it.

Copy link
Member

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

👍 see comment

Signed-off-by: Joas Schilling <coding@schilljs.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Display Location and Local Time next to each User
3 participants