-
Notifications
You must be signed in to change notification settings - Fork 137
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
Conversation
@polkadotazn Thank you 👍 I tried it out and it works great! However, when the date is more than 30 days in the past, both the tooltip and the date show the same long date: 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 |
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 :) |
src/View/Helper/DateHelper.php
Outdated
@@ -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]); |
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.
This code results in the following:
I think you could as well remove the time:
$formattedDate = $dateObj->i18nFormat([\IntlDateFormatter::LONG, \IntlDateFormatter::NONE]);
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.
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.
that makes sense!
alrighty how's it looking now? @jiru |
@polkadotazn Perfect! 👍 Thanks again 😄 |
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