Lunar Date picker custom from material-ui-pickers
npm install material-ui-pickers-lunarsh
npm i material-ui-pickers-lunar
`Now choose the library that pickers will use to work with date. We are providing interfaces for moment and date-fns. If you are not using moment in the project (or dont have it in the bundle already) we suggest using date-fns, because it's much more lightweight and will be correctly tree-shaked from the bundle. Note, that we support only the 2.0.0-alpha.7 version of date-fns for now (see #414). Stay tuned!
`sh
npm i date-fns@2.0.0-alpha.7
// or
npm i moment
// or
npm i luxon
`Then teach pickers which library to use with
MuiPickerUtilsProvider. This component takes a utils property, and makes it available down the React tree thanks to React context. It should preferably be used at the root of your component tree.`jsx
import MomentUtils from 'material-ui-pickers/utils/moment-utils';
import DateFnsUtils from 'material-ui-pickers/utils/date-fns-utils';
import LuxonUtils from 'material-ui-pickers/utils/luxon-utils';
import MuiPickersUtilsProvider from 'material-ui-pickers/utils/MuiPickersUtilsProvider';function App() {
return (
);
}
render( , document.querySelector('#app'));
`And the last step of installation would be an icon font. By default, we are relying on material-icons font, but it's possible to override any icons with the help of corresponding props.
`html
``