From ea4423bab7d3a7c14185ecd431e55e6c549169b7 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Fri, 14 Nov 2008 08:39:39 +0000 Subject: [PATCH] Better handling of text for submit button on already scheduled pages/posts git-svn-id: https://develop.svn.wordpress.org/trunk@9678 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/js/page.js | 4 ++-- wp-admin/js/post.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-admin/js/page.js b/wp-admin/js/page.js index 6af8a4d74b..6da0ebd835 100644 --- a/wp-admin/js/page.js +++ b/wp-admin/js/page.js @@ -32,10 +32,10 @@ jQuery(document).ready( function($) { var attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val()); var originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val()); var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val()); - if ( attemptedDate > currentDate ) { + if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) { var publishOn = postL10n.publishOnFuture; $('#publish').val( postL10n.schedule ); - } else if ( $('#original_post_status').val() != 'publish' ) { + } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) { var publishOn = postL10n.publishOn; $('#publish').val( postL10n.publish ); } else { diff --git a/wp-admin/js/post.js b/wp-admin/js/post.js index 74e4c665db..dbee07e939 100644 --- a/wp-admin/js/post.js +++ b/wp-admin/js/post.js @@ -219,10 +219,10 @@ jQuery(document).ready( function($) { var attemptedDate = new Date( $('#aa').val(), $('#mm').val() -1, $('#jj').val(), $('#hh').val(), $('#mn').val()); var originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val()); var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val()); - if ( attemptedDate > currentDate ) { + if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) { var publishOn = postL10n.publishOnFuture; $('#publish').val( postL10n.schedule ); - } else if ( $('#original_post_status').val() != 'publish' ) { + } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) { var publishOn = postL10n.publishOn; $('#publish').val( postL10n.publish ); } else {