Skip to content

Commit

Permalink
Chrome: Fix new posts publish button label
Browse files Browse the repository at this point in the history
Adding an error threshold when comparing client/server dates
  • Loading branch information
youknowriad committed Oct 18, 2017
1 parent d271c8c commit 50191ca
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion editor/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,10 @@ export function isEditedPostSaveable( state ) {
*/
export function isEditedPostBeingScheduled( state ) {
const date = getEditedPostAttribute( state, 'date' );
return moment( date ).isAfter( moment() );
// Adding 1 minute as an error threshold between the server and the client dates.
const now = moment().add( 1, 'minute' );

return moment( date ).isAfter( now );
}

/**
Expand Down

0 comments on commit 50191ca

Please sign in to comment.