Modify

Opened 9 years ago

Closed 6 years ago

#3086 closed enhancement (fixed)

[patch] Admin "Last Login" users info should use correct time zone

Reported by: Pedro Algarvio, aka, s0undt3ch Owned by: Steffen Hoffmann
Priority: normal Component: AccountManagerPlugin
Severity: trivial Keywords: timezone locale
Cc: Trac Release: 0.11

Description

On the admin page, the last login info about the users should use req.tz to use the admin's selected TZ.

Or, as an alternative, start using pretty_timedelta?

Have the pretty_timedelta as an extra option?

Attachments (2)

last_visit_as_timedelta.patch (1.2 KB) - added by Pedro Algarvio, aka, s0undt3ch 9 years ago.
Just as a sugestion
timezone.patch (560 bytes) - added by Sebastian Krysmanski 8 years ago.
Patch against r5836 and Trac 0.11.4

Download all attachments as: .zip

Change History (7)

comment:1 Changed 9 years ago by Pedro Algarvio, aka, s0undt3ch

Hmm, apparently format_datetime respects the admin's TZ even if no tzinfo is passed.

I tried both:

format_datetime(last_visit, tzinfo=req.tz)

and:

format_datetime(last_visit)

Same results.

Guess the ticket is now just about the pretty_timedelta

Changed 9 years ago by Pedro Algarvio, aka, s0undt3ch

Just as a sugestion

comment:2 in reply to:  1 Changed 9 years ago by Alex Baeza

Replying to s0undt3ch:

Hmm, apparently format_datetime respects the admin's TZ even if no tzinfo is passed.

I'm new to trac. What does this mean? It seems to me as if you are saying that using the format command, you can get the correct timezone to display ( in reports? ).

Can you also use the format command you describe to fix the timezone on the Admin tab?

If so, which file do I need to edit to affect the change?

P.S. I use trac 0.10

Changed 8 years ago by Sebastian Krysmanski

Attachment: timezone.patch added

Patch against r5836 and Trac 0.11.4

comment:3 in reply to:  1 Changed 8 years ago by Sebastian Krysmanski

Replying to s0undt3ch:

Hmm, apparently format_datetime respects the admin's TZ even if no tzinfo is passed.

I tried both:

format_datetime(last_visit, tzinfo=req.tz)

and:

format_datetime(last_visit)

Same results.

Guess the ticket is now just about the pretty_timedelta

At least in Trac 0.11.4 this is not true. The results are different (see trac.util.datefmt.format_datetime which says tz = tzinfo or localtz). So I've added a patch that fixes this "problem" with req.tz and format_datetime.

Btw. I think it's not such a good idea to use a relative timestamp here.

comment:4 Changed 6 years ago by Steffen Hoffmann

Keywords: timezone locale added
Owner: changed from Matt Good to Steffen Hoffmann
Status: newassigned
Summary: Admin Last Login Users Info should use req.tz[patch] Admin "Last Login" users info should use correct time zone

I've seen this working with Trac 0.12 without a patch.

I'll add the patch to correct this for older Trac as seems to be required. It'll not hurt anyway.

pretty_timedelta get's a clear 'wontfix' from me as well. While the value could be disputed in general, IMHO this is certainly not helpful at all in this use case.

comment:5 Changed 6 years ago by Steffen Hoffmann

Resolution: fixed
Status: assignedclosed

(In [9240]) AccountManagerPlugin: Use Trac's time zone setting to display time stamps correctly, closes #3086.

Modify Ticket

Action
as closed The owner will remain Steffen Hoffmann.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.