Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DateTime: Add default date/time to stories #67678

Merged
merged 1 commit into from
Dec 6, 2024

Conversation

tyxla
Copy link
Member

@tyxla tyxla commented Dec 6, 2024

What?

Fixes a couple of warnings in the DateTime component family stories.

Why?

There are warnings because we don't have an initial date or time.

Found while working on #67574.

How?

We're updating the stories to have initial date or time set.

Testing Instructions

Testing Instructions for Keyboard

Same

Screenshots or screencast

Warnings before this PR:
Screenshot 2024-12-06 at 11 18 28

@tyxla tyxla added [Type] Enhancement A suggestion for improvement. [Package] Components /packages/components Storybook Storybook and its stories for components labels Dec 6, 2024
@tyxla tyxla requested review from Mamaduka, t-hamano and a team December 6, 2024 09:21
@tyxla tyxla self-assigned this Dec 6, 2024
@tyxla tyxla requested a review from ajitbohra as a code owner December 6, 2024 09:21
Copy link

github-actions bot commented Dec 6, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: tyxla <[email protected]>
Co-authored-by: Mamaduka <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@tyxla tyxla merged commit 0d7312b into trunk Dec 6, 2024
71 of 73 checks passed
@tyxla tyxla deleted the add/date-time-stories-default-date branch December 6, 2024 11:23
@github-actions github-actions bot added this to the Gutenberg 19.9 milestone Dec 6, 2024
@mirka
Copy link
Member

mirka commented Dec 9, 2024

I think this means we have a bug? The TS types say currentDate can be undefined, and the code looks like it wants to handle currentDate being falsey.

I'm also noticing some discrepancy between the prop description ("Optionally pass in a null value to specify no date is currently selected") and the actual behavior (currentDate={ undefined } and currentDate={ null } both fall back to new Date() being selected).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Components /packages/components Storybook Storybook and its stories for components [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants