Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 28 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"@types/npm-package-arg": "6.1.1",
"@types/prettier": "2.4.4",
"@types/qs": "6.9.7",
"@types/react-dates": "17.1.10",
"@types/react-dates": "21.8.3",
"@types/requestidlecallback": "0.3.4",
"@types/semver": "7.3.8",
"@types/sprintf-js": "1.1.2",
Expand Down
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- `CheckboxControl`: Add unit tests ([#41165](https://github.com/WordPress/gutenberg/pull/41165)).
- `BorderBoxControl`: fix some layout misalignments, especially for RTL users ([#41254](https://github.com/WordPress/gutenberg/pull/41254)).
- `TimePicker`: Update unit tests to use `@testing-library/user-event` ([#41270](https://github.com/WordPress/gutenberg/pull/41270)).
- `DateTimePicker`: Update `moment` to 2.26.0 and update `react-date` typings ([#41266](https://github.com/WordPress/gutenberg/pull/41266)).

### Experimental

Expand Down
2 changes: 1 addition & 1 deletion packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"highlight-words-core": "^1.2.2",
"lodash": "^4.17.21",
"memize": "^1.1.0",
"moment": "^2.22.1",
"moment": "^2.26.0",
"re-resizable": "^6.4.0",
"react-colorful": "^5.3.1",
"react-dates": "^21.8.0",
Expand Down
10 changes: 3 additions & 7 deletions packages/components/src/date-time/date.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ import { noop } from 'lodash';

// `react-dates` doesn't tree-shake correctly, so we import from the individual
// component here.
// @ts-expect-error TypeScript won't find any type declarations at
// `react-dates/lib/components/DayPickerSingleDateController` as they're located
// at `react-dates`.
import UntypedDayPickerSingleDateController from 'react-dates/lib/components/DayPickerSingleDateController';
import type { DayPickerSingleDateController } from 'react-dates';
const TypedDayPickerSingleDateController = UntypedDayPickerSingleDateController as DayPickerSingleDateController;
import DayPickerSingleDateController from 'react-dates/lib/components/DayPickerSingleDateController';

/**
* WordPress dependencies
Expand Down Expand Up @@ -176,8 +171,9 @@ export function DatePicker( {

return (
<div className="components-datetime__date" ref={ nodeRef }>
<TypedDayPickerSingleDateController
<DayPickerSingleDateController
date={ momentDate }
initialVisibleMonth={ null }
daySize={ 30 }
focused
hideKeyboardShortcutsPanel
Expand Down