codidact / qpixel

Q&A-based community knowledge-sharing software
https://codidact.com
GNU Affero General Public License v3.0
385 stars 68 forks source link

More human readable datetime for user creation date on user profile page #1345

Open trichoplax opened 4 months ago

trichoplax commented 4 months ago

Is your feature request related to a problem? Please describe. See also discussion on #1340. The user creation date on the user profile page is currently a datetime that will for everyday use be more information than required, and slower to read:

User since 2024-05-11 12:51:22 UTC

Describe the solution you'd like We could show a less accurate but easier to read time elapsed, for consistency with other datetimes, with the full datetime shown on click or tap. This could use the time_ago_in_words function to show:

User for 16 days

Additional context I've recommended that the format change on click or tap, rather than on hover, in order to make the more detailed datetime available on mobile. It might be helpful to extract this functionality so that it can be used elsewhere, to gradually change more parts of the user interface to have detailed datetimes available on mobile. Ideally a second click/tap would return the format to its default shorter state.