Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

Commit

Permalink
Merge pull request #97 from xwp/bugfix/schedule-snapshot
Browse files Browse the repository at this point in the history
Fix timezone issue on compare date
  • Loading branch information
westonruter committed Oct 25, 2016
2 parents 5900671 + 67e1441 commit 8a253fd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion php/class-customize-snapshot-manager.php
Expand Up @@ -1129,7 +1129,7 @@ public function handle_update_snapshot_request() {
$publish_date = isset( $_POST['publish_date'] ) ? $_POST['publish_date'] : '';
if ( 'future' === $status ) {
$publish_date_obj = new \DateTime( $publish_date );
$current_date = new \DateTime();
$current_date = new \DateTime( current_time( 'mysql' ) );
if ( empty( $publish_date ) || ! $publish_date_obj || $publish_date > $current_date ) {
status_header( 400 );
wp_send_json_error( 'bad_schedule_time' );
Expand Down

0 comments on commit 8a253fd

Please sign in to comment.