-
Notifications
You must be signed in to change notification settings - Fork 522
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
Corrected tooltip hover information #3270
Conversation
@@ -369,13 +369,13 @@ history-Translation--span-copied = | |||
.title = Copied ({ $machinerySources }) | |||
|
|||
history-translation--approved = | |||
.title = Approved by { $user } on { DATETIME($reviewedDate, dateStyle:"long", timeStyle:"medium") } | |||
.title = Approved by { $user } on { DATETIME($reviewedDate, month: "long", year: "numeric", day: "numeric", hour: "numeric", minute: "numeric", second: "numeric") } |
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.
What's the purpose of this change?
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 change allows me to print the date without the Weekday as well. Is there a more succinct way of doing this?
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 format looks OK. It's the tooltip shown when you hover the translation creation date that is showing the weekday:
#2763 (comment)
@@ -196,17 +196,23 @@ export function HistoryTranslationBase({ | |||
|
|||
const review = { | |||
id: 'history-translation--unreviewed', | |||
vars: { user: '', reviewedDate: new Date(translation.dateIso) }, | |||
vars: { user: '', reviewedDate: new Date() }, |
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.
Can we completely drop reviewedDate
here?
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.
Potentially... is there a way for me to pass approvedDate
or rejectedDate
to the .ftl file if we do remove this variable?
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.
Ah, I missed that this was part of an FTL message.
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.
Can we use ''
instead of new Date()
?
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.
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.
Makes sense. Let's keep new Date()
.
pontoon/base/views.py
Outdated
"date": t.date.strftime("%b %d, %Y %H:%M"), | ||
"date_iso": t.date.isoformat(), |
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.
We no longer use translation.date
on frontend, so we can drop it. We can also drop .isoformat()
.
At that point we should rename date_iso
to date
(also on the frontend).
"date": t.date.strftime("%b %d, %Y %H:%M"), | |
"date_iso": t.date.isoformat(), | |
"date": t.date, |
year: 'numeric', | ||
month: 'long', | ||
day: 'numeric', | ||
hour: 'numeric', | ||
minute: 'numeric', | ||
second: 'numeric', |
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.
To be consistent with the format used for the review timestamp and more concise, let's use this:
year: 'numeric', | |
month: 'long', | |
day: 'numeric', | |
hour: 'numeric', | |
minute: 'numeric', | |
second: 'numeric', | |
dateStyle: 'long', | |
timeStyle: 'medium', |
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.
Nice work! Only one comment left.
date={new Date(translation.dateIso)} | ||
title={`${translation.date} UTC`} | ||
date={new Date(translation.date)} | ||
title='' |
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.
Seems like we can remove the title
attribute?
Fix #2763
Made changes to previous pull request to correctly display the last day an action was taken upon a translation. Additionally, removed the Weekday within the information displayed in the tooltip. See #3263 for more context.
Updated Tooltip: