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

lightbox: Use a friendlier format for the date #1197

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

lakshya1goel
Copy link

Key Changes

Changed the timestamp format from Mar 31, 2023 15:09:51 to a more readable Mar 31, 2023 at 3:09 PM.
Added proper localization support to adapt timestamps to the user's language and region preferences.
Optimized the timestamp logic to ensure accurate categorization into Today, Yesterday, or specific dates.
Modified test also to ensure the correct format of date.

Issue: #45

Screenshots:

WhatsApp Image 2024-12-22 at 7 43 22 AM WhatsApp Image 2024-12-22 at 7 43 22 AM(1)
WhatsApp Image 2024-12-22 at 7 43 23 AM WhatsApp Image 2024-12-22 at 7 43 23 AM(1)

Changed the timestamp format from Mar 31, 2023 15:09:51 to a more
readable Mar 31, 2023 at 3:09 PM.
Added proper localization support to adapt timestamps to the user's
language and region preferences.
Optimized the timestamp logic to ensure accurate categorization into
Today, Yesterday, or specific dates.

Fixes: zulip#45
@gnprice gnprice added the maintainer review PR ready for review by Zulip maintainers label Dec 23, 2024
@@ -249,7 +249,7 @@ void main() {
matching: find.textContaining(findRichText: true,
eg.otherUser.fullName)));
check(labelTextWidget.text.toPlainText())
.contains('Jul 23, 2024 23:12:24');
.contains('Jul 23, 2024 at 11:12 PM');
Copy link

@apoorvapendse apoorvapendse Dec 28, 2024

Choose a reason for hiding this comment

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

I think you should add checks for the other behaviors as well like "a few minutes ago".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer review PR ready for review by Zulip maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants