Skip to content

change bootstrap frozen time for #2319#2471

Merged
jiru merged 3 commits intoTatoeba:devfrom
polkadotazn:issue-2319
Aug 10, 2020
Merged

change bootstrap frozen time for #2319#2471
jiru merged 3 commits intoTatoeba:devfrom
polkadotazn:issue-2319

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 :)


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