UNPKG

react-garden

Version:

React + TypeScript + ThreeJS app using Material UI on NextJS, Apollo Client, GraphQL + WordPress REST APIs, for ThreeD web development.. a part of the threed.ai code family.

44 lines (37 loc) 1.25 kB
// ** React Imports import { useState } from 'react' // ** MUI Imports import Box from '@mui/material/Box' // ** Third Party Imports import { addDays, subDays } from 'date-fns' import DatePicker from 'react-datepicker' // ** Custom Component Imports import CustomInput from './PickersCustomInput' const PickersCustomization = () => { // ** States const [dateFormat, setDateFormat] = useState(new Date()) const [dateHighlight, setDateHighlight] = useState(new Date()) return ( <Box sx={{ display: 'flex', flexWrap: 'wrap' }} className='demo-space-x'> <Box> <DatePicker id='custom-format' selected={dateFormat} dateFormat='MMMM d, yyyy h:mm aa' onChange={date => setDateFormat(date)} customInput={<CustomInput label='Custom Date Format' />} /> </Box> <Box> <DatePicker id='highlight-dates' selected={dateHighlight} onChange={date => setDateHighlight(date)} customInput={<CustomInput label='Highlight Dates' />} highlightDates={[subDays(new Date(), 7), addDays(new Date(), 7)]} /> </Box> </Box> ) } export default PickersCustomization