Post Date | Last Modified date is not rendered when it's the same as the the published date #53238
Labels
[Block] Post Date
Affects the Post Date Block
[Type] Bug
An existing feature does not function as intended
Description
The Last Modified Date variant of the Post Date block does not render anything when the last updated date is the same as the published date.
https://github.com/WordPress/gutenberg/blob/c05c66c221ef3f5b43f094f229755adf3ef4515b/packages/block-library/src/post-date/index.php#L33C1-L45
This creates Layout issues because there is no way for the surrounding blocks to respond to whether or not the block will render anything.
In most cases where the last modified date is displayed, it needs additional context to showcase users what the date is actually displaying. So for example a paragraph before the block saying "Last Updated:"
However since the last modified block sometimes just doesn't render anything, this causes an issue where the text "Last Updated:" still displays. But the field itself just shows nothing.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
No response
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
The text was updated successfully, but these errors were encountered: