Repository navigation
Post fields: move date fields from edit-site to fields package - #66938
Conversation
|
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
| import type { BasePost } from '../../types'; | ||
|
|
||
| const getFormattedDate = ( dateToDisplay: string | null ) => | ||
| dateI18n( |
There was a problem hiding this comment.
One interesting thing from migrating this to TypeScript is that it forces you to pass the last parameter. Despite what the docs say, there's no default value and cannot be undefined.
There was a problem hiding this comment.
I think this can be solved by slightly changing the type definition of the function and making the argument optional =something rather than something | undefined
There was a problem hiding this comment.
Reverted the default parameter and modified the JSDoc instead at 544bf3e
| @@ -1,5 +1,5 @@ | |||
| type PostStatus = | |||
| | 'published' | |||
| | 'publish' | |||
There was a problem hiding this comment.
This was the wrong value.
|
Size Change: +77 B (0%) Total Size: 1.82 MB
ℹ️ View Unchanged
|
|
Flaky tests detected in 012a507. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/11803354795
|
9cbcd77 to
9e44b6f
Compare
012a507 to
e92d04e
Compare
| { "path": "../core-data" }, | ||
| { "path": "../data" }, | ||
| { "path": "../dataviews" }, | ||
| { "path": "../date" }, |
There was a problem hiding this comment.
Sorted alphabetically, like the package.json, and added date as a reference. A bit obscure to see, but, without this, npm run lint:tsconfig would cause the lint job to fail (see):
npm run lint:tsconfig exited with code 1
Part of #61084
What?
This PR moves the
datefield definition fromedit-siteto thefieldspackage.Why?
In preparation for moving the whole
usePostFieldshook (conversation).Testing Instructions
Visit the Pages page and verify that the "Date" field still works as expected (visualization, edit).