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

Keep timezone on same line as time #1344

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 shown on the user profile page (only visible on your own user profile page unless you are a moderator) wraps over two lines of text when the page width gets narrower (before it gets so narrow that the page switches to mobile view). At some widths this leads to the timezone showing on a different line to the time.

For example:

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

Describe the solution you'd like This could be fixed by using a non-breaking space between the time and the timezone, which would cause the time and timezone to stay together when the line breaks:

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

Additional context There may be other places where the time and timezone are split across 2 lines. If so, it could be useful to have a function that gives the datetime in the required format, rather than rewriting the same code in each of these places.