-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Posts: Improve Clarity of Scheduled Time #40843
Conversation
? scheduledDate.calendar() | ||
: scheduledDate.format( 'LL' ) + | ||
' ' + | ||
this.props.translate( 'at', { |
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.
ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 3 times:
translate( 'at', { context: 'time comment was posted'} )
ES Score: 7
See 1 additional suggestions in the PR translation status page
ℹ️ This context is really long. Are you sure you don't want to use a translator comment instead?
This is so much clearer. 👍 /cc @Automattic/dotcom-manage-design because I worry the strings are too long for a relatively small space. I wonder if we shortened it to something like "Scheduled for Feb 5" with a tooltip that specified the exact time? That's not particularly elegant, though... |
' ' + | ||
scheduledDate.format( 'LT' ); | ||
|
||
statusText = this.props.translate( 'scheduled for %(scheduledTime)s', { |
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.
ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 1 times:
translate( 'scheduled %(scheduledTime)s' )
ES Score: 7
Co-Authored-By: Alex Kirk <akirk@users.noreply.github.com>
It definitely seems a bit crowded on small screens. I think the year is a useless piece information, unless it is more than one year in the future. If you are in December 2020, and it says "scheduled for Jan, 5th". It is straightforward that means January 2021... |
@sixhours and @Automattic/dotcom-manage-design I'm not sure we need to display multiple dates in this case. Looking back at wp-admin the date shown is contextual to the post status. For published, we show last publish date, for drafts last modified, and for scheduled the most important piece of information is when it will be published in the future vs the last edit. There's a bit of ambiguity in Calypso, with the icon over a text label, which is maybe why we tried showing both? |
const now = moment(); | ||
const scheduledDate = moment( this.props.post.date ); | ||
// If the content is scheduled to be release within a year, do not display the year at the end | ||
const displayDate = scheduledDate.diff( now, 'years' ) > 0 ? 'll' : 'D MMM'; |
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.
D MMM
assumes that languages use a day-month format but some use month-day. Couldn't we rather replace the Y
from the generated ll
? Something like this:
if ( scheduledDate.diff( now, 'years' ) < 1 ) scheduledTime.replace( scheduledDate.format( 'Y' ), '' );
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.
@mmtr could we please get this addressed also? Thanks!
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.
Thanks, fixed! :)
@gwwar It has always been misleading on calypso. Mainly because the icon is always the same, so there is no way to distinguish which date is being displayed. Now that "posts" and "pages" are using the same component to display this information, it will be way easier to fix it, although it goes out of the scope of this very issue, and we definitely need some guideline from @sixhours to know where we are headed. Maybe getting slightly different icons to carry the ideas of "last modified", "published on" and "scheduled for" would be enough?
|
For this PR, I like that the post date is clear about what time it is scheduled for. I agree with @gwwar that an easy fix to reduce the amount of copy is to remove the "last modified" date entirely and only display the date it's published, or the date it's scheduled. But I don't know how that stacks up against past changes, I'm coming into this in the middle. Apologies if I'm confusing things even more. :) |
Would you like to pick @lcollette? I'm in favor of dropping the less important date, so we can have a proper text label. (I always find mystery icons without a text label to be super confusing). Happy to defer here though if y'all had other thoughts. |
I also agree with removing the last modified date entirely. The date it's published, or scheduled to publish, seems more useful. |
@lcollette should we remove the last modified date then on this PR? Or are you suggesting to do it as a follow-up? |
I think either would be fine provided the follow up PR is relatively quick to land after. |
@Aurorum This should be ready to go after addressing the linting issues and taking into consideration the current locale date format when removing the year from the datetime. |
Just making sure we don't merge this before addressing the pending issues
const scheduledDate = moment( this.props.post.date ); | ||
// If the content is scheduled to be release within a year, do not display the year at the end | ||
const scheduledTime = scheduledDate.calendar( null, { | ||
sameElse: this.props.translate( 'll [at] LT', { |
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.
ℹ️ String reuse speeds up translation and improves consistency. The following string might make a good alternative and has already been translated 20 times:
translate( 'LL [at] LT' )
ES Score: 12
I think both should now be fixed, thanks @mmtr! :) |
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.
Thanks @Aurorum! This tests well for me.
Before | After |
---|---|
![]() |
![]() |
We can possibly use a sentence case notation when the scheduled date is today/tomorrow in order to avoid a capitalized Today/Tomorrow, but not a blocker here.
Filed #41075 to follow up on removing the last modified date on scheduled posts. |
Changes proposed in this Pull Request
This ensures that the scheduled time clearly states when the post is due to be released.
Testing instructions
A few things to check:
Before:
![Screenshot 2020-04-07 at 11 58 36](https://user-images.githubusercontent.com/43215253/78661693-2141b200-78c7-11ea-95c4-d1e8bfe47004.png)
After:
![Screenshot 2020-04-07 at 12 08 36](https://user-images.githubusercontent.com/43215253/78662560-8ba72200-78c8-11ea-9a94-5d03fea7f47e.png)
Note: I made a few changes so that it displays the date and then "at" (eg.
27 April 2020 at 02:00
) so that it's consistent with the wording for a post due to be published in under 7 days.Follows up to #40779 and #40584
Fixes #12052