You might want to replace Moment.js with another date library (now support [dayjs](https://day.js.org) and [date-fns](https://date-fns.org)) to reduce bundle size. We provide two ways to customize:
### Custom component
## Custom component
The first way is use `generatePicker` (or `generateCalendar`) helps to create Picker components.
First, we initialize an antd demo with `create-react-app`. You can refer to [Use in TypeScript](/docs/react/use-in-typescript), or you can start directly here [init antd](https://github.com/xiaohuoni/antd4-generate-picker/commit/47fec964e36d48bd15760f8f5abcb9655c259aa6)
@@ -81,7 +81,7 @@ export { default as Calendar } from './Calendar';
export{defaultasTimePicker}from'./TimePicker';
```
#### Use Custom component
### Use Custom component
Modify `src/App.tsx`,import `dayjs` and custom component.
...
...
@@ -99,7 +99,7 @@ If you need JavaScript code, you can refer to [antd4-generate-picker/antd-demo](
If you use [umi](https://umijs.org/), you can reference [antd4-use-dayjs-replace-moment](https://github.com/xiaohuoni/antd4-use-dayjs-replace-moment).
### antd-dayjs-webpack-plugin
## antd-dayjs-webpack-plugin
We also provide another implementation, which we provide with `antd-dayjs-webpack-plugin`, replacing `momentjs` with `Day.js` directly without changing a line of existing code. More info can be found at [antd-dayjs-webpack-plugin](https://github.com/ant-design/antd-dayjs-webpack-plugin).