Skip to content

change bootstrap frozen time for #2319 #2471

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 3 commits into from
Aug 10, 2020
Merged

Conversation

polkadotazn
Copy link
Contributor

@polkadotazn polkadotazn commented Jul 24, 2020

Hi, I'm really sorry it has taken so long. I ended up making a new branch for this issue. Please let me know how it looks. @trang @jiru @AndiPersti

@jiru
Copy link
Member

jiru commented Jul 24, 2020

@polkadotazn Thank you 👍 I tried it out and it works great!
ok

However, when the date is more than 30 days in the past, both the tooltip and the date show the same long date:
ko

As you can see, it is so long that it got ellipsed out. In that case, I think the date displayed on the comment block should be more concise (for example only day, month and year), while the tooltip can show the full format including the time and "UTC". You can try this case by manually changing the date of a comment with a SQL request such as update sentence_comments set created = '2010-10-10 01:22:33' where id = 2;.

@polkadotazn
Copy link
Contributor Author

I see. good catch, thanks! I updated the past 30 days dates! I'm not sure if this was the best way to do it, so please let me know if there's a better method :)

@@ -124,7 +124,7 @@ public function ago($date, $alone=true)
$diff = Time::fromNow($dateObj);

if ($diff->days > 30) {
$formattedDate = $dateObj->nice();
$formattedDate = $dateObj->i18nFormat([\IntlDateFormatter::LONG, \IntlDateFormatter::SHORT]);
Copy link
Member

@jiru jiru Aug 8, 2020

Choose a reason for hiding this comment

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

This code results in the following:
image

I think you could as well remove the time:

$formattedDate =  $dateObj->i18nFormat([\IntlDateFormatter::LONG, \IntlDateFormatter::NONE]);

So that we get instead:
image

The rationale is that we are not displaying the time for dates between 1 and 30 days ago, so we shouldn’t display it for dates older than 30 days ago too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that makes sense!

@polkadotazn
Copy link
Contributor Author

alrighty how's it looking now? @jiru

@jiru
Copy link
Member

jiru commented Aug 10, 2020

@polkadotazn Perfect! 👍 Thanks again 😄

@jiru jiru merged commit 4daf720 into Tatoeba:dev Aug 10, 2020
@jiru jiru added this to the 2020-08-16 milestone Aug 10, 2020
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