Modify

Opened 7 years ago

Closed 4 years ago

#3086 closed enhancement (fixed)

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

Reported by: s0undt3ch Owned by: hasienda
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 s0undt3ch 7 years ago.
Just as a sugestion
timezone.patch (560 bytes) - added by manski 6 years ago.
Patch against r5836 and Trac 0.11.4

Download all attachments as: .zip

Change History (7)

comment:1 follow-ups: Changed 7 years ago by 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 7 years ago by s0undt3ch

Just as a sugestion

comment:2 in reply to: ↑ 1 Changed 6 years ago by tiamot

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 6 years ago by manski

Patch against r5836 and Trac 0.11.4

comment:3 in reply to: ↑ 1 Changed 6 years ago by manski

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 4 years ago by hasienda

  • Keywords timezone locale added
  • Owner changed from mgood to hasienda
  • Status changed from new to assigned
  • Summary changed from Admin Last Login Users Info should use req.tz to [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 4 years ago by hasienda

  • Resolution set to fixed
  • Status changed from assigned to closed

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

Add Comment

Modify Ticket

Action
as closed The owner will remain hasienda.
The resolution will be deleted. Next status will be 'reopened'.
Author


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

 
Note: See TracTickets for help on using tickets.