Make WordPress Core

Opened 14 months ago

Last modified 3 months ago

#62229 new defect (bug)

post_status dropdown in Quick Edit incorrect if the admin user's timezone is "behind" the site's timezone

Reported by: pbiron's profile pbiron Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 6.3
Component: Quick/Bulk Edit Keywords: has-patch
Focuses: javascript Cc:

Description (last modified by SergeyBiryukov)

[55560] introduced a bug of its own.

Steps to reproduce:

  1. set the site's Timezone to something East of admin user's timezone (e.g., admin user's timezone is America/Denver and the site's new Timezone is America/New York).
  2. create a post and publish it
  3. Quick Edit the newly published post and see that the options in the Status dropdown are "Scheduled", "Pending Review", and "Draft"...with "Scheduled" selected.

Expected result: the options should be "Published", "Pending Review", and "Draft"...with "Published" selected.

Change History (5)

#1 @SergeyBiryukov
13 months ago

  • Description modified (diff)

#2 @pbiron
13 months ago

related: #38834

#3 @sabernhardt
12 months ago

  • Focuses javascript added

#4 @tivnetinc
3 months ago

The bug is still there (WP 6.8.2)

inline-edit-post.js line 433

var post_date_string = $(':input[name="aa"]').val() + '-' + $(':input[name="mm"]').val() + '-' + $(':input[name="jj"]').val();
post_date_string += ' ' + $(':input[name="hh"]').val() + ':' + $(':input[name="mn"]').val() + ':' + $(':input[name="ss"]').val();
var post_date = new Date( post_date_string );

// ------- I DO NOT SEE TIMEZONE HERE ^^^ ---------
// ------- Then the comparison below looks wrong
// ------- If WP date is UTC and Admin timezone is UTC+..


status = $('._status', rowData).text();
if ( 'future' !== status && Date.now() > post_date ) {
 $('select[name="_status"] option[value="future"]', editRow).remove();
} else {
 $('select[name="_status"] option[value="publish"]', editRow).remove();
}

This ticket was mentioned in PR #9711 on WordPress/wordpress-develop by @karthikeya01.


3 months ago
#5

  • Keywords has-patch added
Note: See TracTickets for help on using tickets.