Skip to content

Date formats for recipient headers #411

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

Closed
gnprice opened this issue Nov 22, 2023 · 0 comments · Fixed by #429
Closed

Date formats for recipient headers #411

gnprice opened this issue Nov 22, 2023 · 0 comments · Fixed by #429
Assignees
Labels
a-msglist The message-list screen, except what's label:a-content

Comments

@gnprice
Copy link
Member

gnprice commented Nov 22, 2023

Currently the recipient headers always show the date in full, like "2023-11-22". We should instead use the same formats we have in web:

  • "Today" and "Yesterday" when accurate;
  • Otherwise month and day, or year, month, and day, with certain logic for deciding between those.

For the exact logic, see the (oddly-named) render_now function in web/src/timerender.ts in Zulip web.

The web implementation ultimately relies on the JS Intl.DateTimeFormat class. We should be able to get equivalent results using Dart's DateFormat from package:intl. As a bonus that will also take care of internationalizing these date formats, part of #278.

@gnprice gnprice added the a-msglist The message-list screen, except what's label:a-content label Nov 22, 2023
@gnprice gnprice added this to the Beta 2 milestone Nov 22, 2023
sirpengi added a commit to sirpengi/zulip-flutter that referenced this issue Nov 30, 2023
Show relative time labels such as "Today" or "Yesterday",
and dates far in the past have their year attached.
Technically these terms are "deictic temporal pronouns" but
that term seemed too academic, so decided on `temporalNoun`
for labeling them in translations.

Fixes: zulip#411
sirpengi added a commit to sirpengi/zulip-flutter that referenced this issue Dec 4, 2023
Show relative time labels such as "Today" or "Yesterday",
and dates far in the past (or somehow in the future) have
their year attached.

Fixes: zulip#411
sirpengi added a commit to sirpengi/zulip-flutter that referenced this issue Dec 4, 2023
Show relative time labels such as "Today" or "Yesterday",
and dates far in the past (or somehow in the future) have
their year attached.

Fixes: zulip#411
sirpengi added a commit to sirpengi/zulip-flutter that referenced this issue Dec 4, 2023
Show relative time labels such as "Today" or "Yesterday",
and dates far in the past (or somehow in the future) have
their year attached.

Fixes: zulip#411
@gnprice gnprice closed this as completed in a2db566 Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-msglist The message-list screen, except what's label:a-content
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants