Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Plugin: CustomMessageTimestamps #3189

Open
wants to merge 5 commits into
base: dev
Choose a base branch
from

Conversation

lolsuffocate
Copy link
Contributor

@lolsuffocate lolsuffocate commented Jan 31, 2025

CustomMessageTimestamps

This plugin allows you to customize the timestamps in chat messages and tooltips.

This is a rework of Rini and nvhhr's plugin and as such both are included as devs too.

Formats

  • Cozy: The timestamp by your username when chat is in cozy mode.
    cozy

  • Compact: The timestamp to the left of messages when chat is in compact mode and when you send multiple messages in cozy mode.
    compact

  • Tooltip: The timestamp in the tooltip when hovering over a message.
    tootip

Placeholders

  • [calendar]: Replaced with moment.js's calendar time, which dynamically adjusts based on the date.
  • [relative]: Replaced with moment.js's relative time, such as "4 hours ago".

Timeframes for Calendar Time

  • Same day: Format for today's dates (e.g., "Today, 2:30 PM").
  • Last day: Format for yesterday's dates (e.g., "Yesterday, 2:30 PM").
  • Last week: Format for dates within the last week (e.g., "Monday, 2:30 PM").
  • Same else: Format for older dates (e.g., "01/01/2024, 2:30 PM").

settings

For more information on formatting options, refer to the Moment.js formatting documentation.

@lolsuffocate lolsuffocate changed the title Custom message timestamps New Plugin: Custom message timestamps Jan 31, 2025
@lolsuffocate
Copy link
Contributor Author

I've removed the format text from the timestamp children in ReplyTimestamps as <Timestamp/> with no children yields the same result and setting the inner text explicitly overrides this plugin's replacement
image

@lolsuffocate lolsuffocate changed the title New Plugin: Custom message timestamps New Plugin: CustomMessageTimestamps Jan 31, 2025
@Kyuuhachi
Copy link
Contributor

IIRC the custom timestamp content was to get spacing better or something, don't remember if it's for compact or cozy mode. Might also have some accessibility impact with those s. But yeah, if it can use the default without affecting anything, that's better.

@lolsuffocate
Copy link
Contributor Author

I've checked the html with and without and it produces the exact same thing, so we should be good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants