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

DateTimePicker: Replace react-dates and moment with useLilius and date-fns #43005

Merged
418 changes: 26 additions & 392 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion packages/components/CHANGELOG.md
Expand Up @@ -26,7 +26,9 @@

- `Flex`, `FlexItem`, `FlexBlock`: Convert to TypeScript ([#42537](https://github.com/WordPress/gutenberg/pull/42537)).
- `InputControl`: Fix incorrect `size` prop passing ([#42793](https://github.com/WordPress/gutenberg/pull/42793)).
- `Popover`: rewrite Storybook examples using controls [#42903](https://github.com/WordPress/gutenberg/pull/42903)).
- `Popover`: rewrite Storybook examples using controls ([#42903](https://github.com/WordPress/gutenberg/pull/42903)).
- `DateTimePicker`, `TimePicker`, `DatePicker`: Switch from `moment` to `date-fns` ([#43005](https://github.com/WordPress/gutenberg/pull/43005)).
- `DatePicker`: Switch from `react-dates` to `use-lilius` ([#43005](https://github.com/WordPress/gutenberg/pull/43005)).

## 19.16.0 (2022-07-27)

Expand Down
4 changes: 2 additions & 2 deletions packages/components/package.json
Expand Up @@ -55,19 +55,19 @@
"@wordpress/warning": "file:../warning",
"classnames": "^2.3.1",
"colord": "^2.7.0",
"date-fns": "^2.28.0",
"dom-scroll-into-view": "^1.2.1",
"downshift": "^6.0.15",
"framer-motion": "^6.2.8",
"gradient-parser": "^0.1.5",
"highlight-words-core": "^1.2.2",
"lodash": "^4.17.21",
"memize": "^1.1.0",
"moment": "^2.26.0",
"re-resizable": "^6.4.0",
"react-colorful": "^5.3.1",
"react-dates": "^21.8.0",
"reakit": "^1.3.8",
"remove-accents": "^0.4.2",
"use-lilius": "^2.0.1",
noisysocks marked this conversation as resolved.
Show resolved Hide resolved
"uuid": "^8.3.0"
},
"peerDependencies": {
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/date-time/constants.ts
@@ -0,0 +1 @@
export const TIMEZONELESS_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
5 changes: 3 additions & 2 deletions packages/components/src/date-time/date-time/index.tsx
Expand Up @@ -21,6 +21,7 @@ import { CalendarHelp } from './styles';
import { HStack } from '../../h-stack';
import { Heading } from '../../heading';
import { Spacer } from '../../spacer';
import { VStack } from '../../v-stack';

export { DatePicker, TimePicker };

Expand Down Expand Up @@ -63,7 +64,7 @@ function UnforwardedDateTimePicker(
}

return (
<div ref={ ref } className="components-datetime">
<VStack ref={ ref } className="components-datetime" spacing={ 4 }>
{ ! calendarHelpIsVisible && (
<>
<TimePicker
Expand Down Expand Up @@ -186,7 +187,7 @@ function UnforwardedDateTimePicker(
) }
</HStack>
) }
</div>
</VStack>
);
}

Expand Down