@campxdev/shared 1.8.7 → 1.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -3,6 +3,7 @@ import { InputAdornment, TextFieldProps } from '@mui/material'
|
|
|
3
3
|
import 'flatpickr/dist/flatpickr.css'
|
|
4
4
|
import { ReactNode } from 'react'
|
|
5
5
|
import Flatpickr, { DateTimePickerProps } from 'react-flatpickr'
|
|
6
|
+
import monthSelectPlugin from 'flatpickr/dist/plugins/monthSelect'
|
|
6
7
|
import TextField from './TextField'
|
|
7
8
|
|
|
8
9
|
export interface IDatePicker {
|
|
@@ -17,8 +18,17 @@ export interface IDatePicker {
|
|
|
17
18
|
placeholder?: string
|
|
18
19
|
inputProps?: TextFieldProps
|
|
19
20
|
size?: 'medium' | 'small'
|
|
21
|
+
monthSelect?: boolean
|
|
20
22
|
}
|
|
21
23
|
|
|
24
|
+
const plugins = [
|
|
25
|
+
monthSelectPlugin({
|
|
26
|
+
shorthand: true, //defaults to false
|
|
27
|
+
dateFormat: 'm.y', //defaults to "F Y"
|
|
28
|
+
altFormat: 'F Y', //defaults to "F Y"
|
|
29
|
+
}),
|
|
30
|
+
]
|
|
31
|
+
|
|
22
32
|
export default function FormDatePicker({
|
|
23
33
|
name,
|
|
24
34
|
label,
|
|
@@ -29,6 +39,7 @@ export default function FormDatePicker({
|
|
|
29
39
|
placeholder,
|
|
30
40
|
size = 'medium',
|
|
31
41
|
required = false,
|
|
42
|
+
monthSelect,
|
|
32
43
|
...rest
|
|
33
44
|
}: IDatePicker) {
|
|
34
45
|
return (
|