Make WordPress Core

Changeset 9678


Ignore:
Timestamp:
11/14/2008 08:39:39 AM (16 years ago)
Author:
markjaquith
Message:

Better handling of text for submit button on already scheduled pages/posts

Location:
trunk/wp-admin/js
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/page.js

    r9641 r9678  
    3333        var originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val());
    3434        var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val());
    35         if ( attemptedDate > currentDate ) {
     35        if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) {
    3636            var publishOn = postL10n.publishOnFuture;
    3737            $('#publish').val( postL10n.schedule );
    38         } else if ( $('#original_post_status').val() != 'publish' ) {
     38        } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {
    3939            var publishOn = postL10n.publishOn;
    4040            $('#publish').val( postL10n.publish );
  • trunk/wp-admin/js/post.js

    r9654 r9678  
    220220        var originalDate = new Date( $('#hidden_aa').val(), $('#hidden_mm').val() -1, $('#hidden_jj').val(), $('#hidden_hh').val(), $('#hidden_mn').val());
    221221        var currentDate = new Date( $('#cur_aa').val(), $('#cur_mm').val() -1, $('#cur_jj').val(), $('#cur_hh').val(), $('#cur_mn').val());
    222         if ( attemptedDate > currentDate ) {
     222        if ( attemptedDate > currentDate && $('#original_post_status').val() != 'future' ) {
    223223            var publishOn = postL10n.publishOnFuture;
    224224            $('#publish').val( postL10n.schedule );
    225         } else if ( $('#original_post_status').val() != 'publish' ) {
     225        } else if ( attemptedDate <= currentDate && $('#original_post_status').val() != 'publish' ) {
    226226            var publishOn = postL10n.publishOn;
    227227            $('#publish').val( postL10n.publish );
Note: See TracChangeset for help on using the changeset viewer.