-
Notifications
You must be signed in to change notification settings - Fork 322
Follow user's time format setting (12 or 24 hour) #1730
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
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
f9ec516
lightbox [nfc]: Go through MessageTimestampStyle for timestamp
chrisbobbe 55b95d2
msglist [nfc]: Add two params to MessageTimestampStyle.format, to use…
chrisbobbe 7704fd8
msglist [nfc]: Use ZulipBinding.instance.utcNow().toLocal() in DateText
chrisbobbe 3703baa
msglist [nfc]: Finish centralizing on MessageTimestampStyle
chrisbobbe 0a6b2f7
msglist test: Test all `MessageTimestampStyle`s, not just dateOnlyRel…
chrisbobbe 4a77fbd
api: Start accepting null for user_settings.twenty_four_hour_time
chrisbobbe ddc9ade
model [nfc]: Pass TwentyFourHourTimeMode to MessageTimestampStyle.format
chrisbobbe 1d1f426
msglist [nfc]: Remove a hard-coded 'en_US' which is the default
chrisbobbe b7146a7
msglist [nfc]: s/_timeOnlyFormat/_timeFormat/
chrisbobbe 91d4ef3
msglist [nfc]: Pull out a _timeFormatWithSeconds helper
chrisbobbe 4d4928f
msglist [nfc]: Add helpers to resolve TwentyFourHourTimeMode
chrisbobbe 736dc4d
msglist [nfc]: Use a helper field we just added
chrisbobbe 92bae68
msglist: Follow user_settings.twenty_four_hour_time for message times…
chrisbobbe e120e00
content: Follow user_settings.twenty_four_hour_time in global times
chrisbobbe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the binding is a good idea. How about having the callee invoke it? Then it doesn't need to be a parameter that each caller passes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Potentially that happens after the other commits — it might be simpler to do that change after this one:
26d5ef5 msglist [nfc]: Finish centralizing on MessageTimestampStyle
than vice versa.)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking we'd want
format
to be a pure function, so not a right place to check the clock. And I guess that callers would be more likely to take care of refreshing relative times (e.g. #293, #891) if they're responsible for reading the clock. What do you think?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, refreshing relative times is an interesting point. I guess let's leave it this way for now, and we'll see what we come up with to organize the code when we go to handle that.