You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
918 B
36 lines
918 B
6 months ago
|
/* eslint-disable no-unused-vars */
|
||
|
// ** React Imports
|
||
|
import React from 'react'
|
||
|
const Ind = require('flatpickr/dist/l10n/id.js').default.id // ** Reactstrap Imports
|
||
|
import { Label } from 'reactstrap'
|
||
|
|
||
|
// ** Third Party Components
|
||
|
import Flatpickr from 'react-flatpickr'
|
||
|
// ** Styles
|
||
|
import '../scss/react/libs/flatpickr/flatpickr.scss'
|
||
|
const Tanggal = ({ startOrEnd, value, setValue }) => {
|
||
|
// ** State
|
||
|
// const [picker, setPicker] = useState(new Date())
|
||
|
return (
|
||
|
<>
|
||
|
<Label className="form-label" for="hf-picker">
|
||
|
{startOrEnd}
|
||
|
</Label>
|
||
|
<Flatpickr
|
||
|
value={value}
|
||
|
id="hf-picker"
|
||
|
className="form-control tanggal"
|
||
|
onChange={(date) => setValue(date[0].toISOString())}
|
||
|
options={{
|
||
|
locale: Ind,
|
||
|
altInput: true,
|
||
|
altFormat: 'd M Y',
|
||
|
dateFormat: 'Y-m-d'
|
||
|
}}
|
||
|
/>
|
||
|
</>
|
||
|
)
|
||
|
}
|
||
|
|
||
|
export default Tanggal
|