Skip to content

DateTime: Add default date/time to stories #67678

New issue

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

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

Already on ? Sign in to your account

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

@tyxlatyxla added [Type] EnhancementA suggestion for improvement.[Package] Components/packages/componentsStorybookStorybook and its stories for componentslabels Dec 6, 2024
@tyxlatyxla requested review from Mamaduka, t-hamano and a team December 6, 2024 09:21
@tyxlatyxla self-assigned this Dec 6, 2024
@tyxlatyxla requested a review from ajitbohra as a code owner December 6, 2024 09:21
@tyxlatyxla mentioned this pull request Dec 6, 2024
@github-actionsGitHub Actions
Copy link

-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 , 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.

@tyxlatyxla merged commit 0d7312b into trunk Dec 6, 2024
71 of 73 checks passed
@tyxlatyxla deleted the add/date-time-stories-default-date branch December 6, 2024 11:23
@github-actions-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 . Already have an account? Sign in to comment
Labels
[Package] Components/packages/componentsStorybookStorybook and its stories for components[Type] EnhancementA suggestion for improvement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants