? ? Pending

User tests: Successful: Unsuccessful:

avatar PhilETaylor
PhilETaylor
28 Mar 2021

Summary of Changes

Propose showing of relative date instead of date time in the Logged in Users module in admin.

Testing Instructions

Check the Home Dashboard -> Logged In Users module - look at it
Apply PR
Look at it again and note the times are now relative

Actual result BEFORE applying this Pull Request

Screenshot 2021-03-28 at 21 14 12

Expected result AFTER applying this Pull Request

Screenshot 2021-03-28 at 21 14 02

Documentation Changes Required

none

avatar PhilETaylor PhilETaylor - open - 28 Mar 2021
avatar PhilETaylor PhilETaylor - change - 28 Mar 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 28 Mar 2021
Category Modules Administration
avatar PhilETaylor PhilETaylor - change - 28 Mar 2021
Title
Show relative date instead of date time
[4] Show relative date instead of date time in logged in module
avatar PhilETaylor PhilETaylor - edited - 28 Mar 2021
avatar rjharishabh
rjharishabh - comment - 29 Mar 2021

It always shows Less than a minute ago.

avatar PhilETaylor
PhilETaylor - comment - 29 Mar 2021

That is correct. It’s actually a last seen date and not a logged in date time

Check without this PR and you will see the same thing - it updates on page load

Sent from my iPhone

On 29 Mar 2021, at 05:29, Rishabh Ranjan Jha @.***> wrote:


It always shows Less than a minute ago.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

avatar rjharishabh
rjharishabh - comment - 29 Mar 2021

Without this PR, logged in date and time shown,

I think results after this PR should be the same as #32910

avatar PhilETaylor
PhilETaylor - comment - 29 Mar 2021

Without this PR, logged in date and time shown

No it doesnt.

Without this PR, the mod_logged shows the time field from the #__session table which is updated on every page load.

It is retrieved from the #__session table here:

->select('s.time, s.client_id, u.id, u.name, u.username')

This module is not telling you the time someone logged in, as confusing as that is for a module called mod_logged.

Its telling you time the session was updated (the last page load normally)

https://github.com/joomla-framework/session/blob/ea7af528c0349af94ed855d3ee5f843cc4986089/src/Handler/DatabaseHandler.php#L290

This PR make no changes to that logic, all it does is display the date/time in a different way.

avatar rjharishabh
rjharishabh - comment - 29 Mar 2021

Thanks for clarification

avatar PhilETaylor
PhilETaylor - comment - 29 Mar 2021

I can find no examples of getDate accepting a unix timestamp as a parameter, and that's what we have here.

I'll test later tonight.

avatar Harmageddon
Harmageddon - comment - 29 Mar 2021

Can we please make this configurable? As I created PR #31675 already some time ago, where it is documented that not everyone prefers the relative display instead of an absolute one. If we add relative display not only for the action logs, but also in other places in core, it might be better to have a user-specific setting for this instead of the parameter I added for com_actionlogs.

avatar PhilETaylor
PhilETaylor - comment - 29 Mar 2021

If I read the code right, the relative date will only show if the date is less than 4 weeks, else the full date would be shown as normal. The things on the dashboard are recent things, and so a relative date is best for them.

avatar ceford ceford - test_item - 29 Mar 2021 - Tested successfully
avatar ceford
ceford - comment - 29 Mar 2021

I have tested this item successfully on 43cd9ef

I was confused by the Less than a minute ago too but with the explanation of the time being since the last page load I definitely approve. I use this feature quite a loy in a J3 installation.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32911.

avatar alikon
alikon - comment - 29 Mar 2021

i'm not sure if this is the way to go ... like #32910
only my 2eurocent

avatar PhilETaylor
PhilETaylor - comment - 29 Mar 2021

The home dashboard is an overview of the RECENT happenings on a site therefore it MAKES SENSE that this screen should have relative dates.

On normal listing screens date stamps are better, and can be ordered etc, but on the Home Dashboard a relative timestamp is better.... unless your site is dead and inactive and you have nothing to show recently of course, then, the relative date AFTER FOUR WEEKS turns back into a date

IIRC you can also hover over "one hour ago" to see the exact date/time. Apparently not, although that could easily be added.

avatar PhilETaylor PhilETaylor - change - 29 Mar 2021
Labels Added: ?
avatar PhilETaylor
PhilETaylor - comment - 29 Mar 2021

@chmst Suggested: Use Factory::getDate(..)

Done.

avatar alikon
alikon - comment - 29 Mar 2021

maybe i've been unexplicative
matter of personal taste
much more imho

avatar PhilETaylor
PhilETaylor - comment - 29 Mar 2021

Well as Joomla 3.9, 3.10 and 4.0 are no longer accepting "new features" any "preference selection" would have to be a different PR aimed at 4.1 whenever that would be released in 2030+

avatar alikon
alikon - comment - 29 Mar 2021

grr
i always hate when something is on the bordeline
whatever can be your choice....i'm optimistic here 50/50... 2025?
?

avatar PhilETaylor
PhilETaylor - comment - 29 Mar 2021

I'll do the work, but I have no say in when, if ever, it gets merged. At the moment Ive had several rejected.

avatar Harmageddon
Harmageddon - comment - 29 Mar 2021

If I read the code right, the relative date will only show if the date is less than 4 weeks, else the full date would be shown as normal.

That's correct. Still I'm confused by things like "2 weeks ago" or "5 days ago" - was it Wednesday? Thursday? Let me calculate...

Though I see your point here:

The home dashboard is an overview of the RECENT happenings on a site therefore it MAKES SENSE that this screen should have relative dates.

On normal listing screens date stamps are better, and can be ordered etc, but on the Home Dashboard a relative timestamp is better.... unless your site is dead and inactive and you have nothing to show recently of course, then, the relative date AFTER FOUR WEEKS turns back into a date

Whether one or the other is better is a question of personal taste, thus, I'd prefer the parameter. As you see in #31675, there are several people saying "just get rid of the parameter and display it in absolute format" and several saying "just get rid of the parameter and display it in relative format".

I agree that the argumentation for relative dates is stronger in this case here than for the whole action logs table.

IIRC you can also hover over "one hour ago" to see the exact date/time. Apparently not, although that could easily be added.

So I'd kindly ask you to at least include this tooltip in your PRs to give users the chance to see the absolute date.

Well as Joomla 3.9, 3.10 and 4.0 are no longer accepting "new features" any "preference selection" would have to be a different PR aimed at 4.1 whenever that would be released in 2030+

Seems a bit counterintuitive to me that changing the display would be considered a bug fix or cosmetical change (for 4.0), but making it configurable would be a new feature (4.1)?

Okay, you two are writing faster than I am.

I'll do the work, but I have no say in when, if ever, it gets merged. At the moment Ive had several rejected.

Would be very much appreciated! :-)

avatar toivo toivo - test_item - 29 Mar 2021 - Tested successfully
avatar toivo
toivo - comment - 29 Mar 2021

I have tested this item successfully on 2479611

Tested successfully in Beta8-dev of 29 March in Wampserver 3.2.4 using PHP 8.0.2.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32911.

avatar PhilETaylor
PhilETaylor - comment - 31 Mar 2021

Im not going to add yet-another-useless-option to toggle between relative/absolute dates on a dashboard of "recent activity"... sorry. Joomla has enough insane options.

So lets get this tested, (hint: it works) and then we can get it merged and move on.

avatar ceford ceford - test_item - 31 Mar 2021 - Tested successfully
avatar ceford
ceford - comment - 31 Mar 2021

I have tested this item successfully on 2479611

Works fine - I like it.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32911.

avatar Quy Quy - change - 31 Mar 2021
The description was changed
Status Pending Ready to Commit
avatar Quy Quy - edited - 31 Mar 2021
avatar Quy
Quy - comment - 31 Mar 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/32911.

avatar dgrammatiko
dgrammatiko - comment - 7 Apr 2021

Did anyone tested that filtering by date is still functional after applying this PR?

avatar PhilETaylor
PhilETaylor - comment - 7 Apr 2021

Its was not possible before or after this PR to sort by date in this module.

avatar dgrammatiko
dgrammatiko - comment - 7 Apr 2021

Yeah, just realised that this is not a list view although it resembles one

avatar HLeithner
HLeithner - comment - 8 Apr 2021

I'm against this change for multiple reasons but most of them are personal ;-)

Anyway column header is "Date" the value "2 minutes ago" is not a date so it should be "last seen" aside this I prefer real dates especially if the values are bigger then a day. Also there is no fallback like a tooltip with the real date.

avatar PhilETaylor PhilETaylor - close - 8 Apr 2021
avatar PhilETaylor PhilETaylor - change - 8 Apr 2021
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2021-04-08 08:14:17
Closed_By PhilETaylor
Labels Added: ?

Add a Comment

Login with GitHub to post a comment