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

Add setting to enable 24-hour time format #1739

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

Conversation

agmm
Copy link
Contributor

@agmm agmm commented May 14, 2024

Description

Support for the 24-hour time format has been a frequently requested feature in the Cinny Matrix room and has been mentioned in multiple issues: #60, #1333, #1549, #1648. This PR adds a toggle in the settings page that allows the user to switch between 12-hour and 24-hour time formats.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Copy link

github-actions bot commented May 14, 2024

Preview: https://1739--pr-cinny.netlify.app
⚠️ Exercise caution. Use test accounts. ⚠️

Copy link
Member

@ajbura ajbura left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look good. for the simplicity i think we should just call it as hour24Clock

@agmm agmm requested a review from ajbura May 15, 2024 16:51

export type TimeProps = {
compact?: boolean;
ts: number;
};

export const Time = as<'span', TimeProps>(({ compact, ts, ...props }, ref) => {
const [hour24Clock] = useSetting(settingsAtom, 'hour24Clock');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Subscribing to settingsAtom inside Time component can downgrade the perf of our timeline as every Time component in every message will be listening to it where more perf oriented approach can be to receive hour24Clock as component param and we can subscribe to settingsAtom once for all.

@LevitatingBusinessMan
Copy link
Contributor

@agmm are you still willing to update this PR?

@agmm
Copy link
Contributor Author

agmm commented Oct 8, 2024

I totally forgot about this PR, but yes, I am willing to update it. I will take a look as soon as I have the time.

@ajbura ajbura mentioned this pull request Jan 10, 2025
9 tasks
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.

3 participants