WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
9.98k stars 4.01k forks source link

Scheduled Posts using Post Date set to Relative Time show incorrect date in preview #62976

Closed mrfoxtalbot closed 7 hours ago

mrfoxtalbot commented 3 days ago

Description

When you have a Date block on a post, schedule the post to the future, and then preview the post, the Date block shows a past date, even though the editor showed a relative future-tense date.

Step-by-step reproduction instructions

  1. Using Gutenberg 18.6.0, create a new post
  2. Add the Date Block
  3. Select the last option in CHOOSE A FORMAT
  4. Schedule the post for a future date
  5. Preview the post

Screenshots, screen recording, code snippet

This option: Annotation on 2024-06-28 at 15-09-19

Shows the wrong date in the preview: Annotation on 2024-06-28 at 13-28-45

Environment info

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

amitraj2203 commented 3 days ago

I will submit a PR soon for its fix.