added proper date
This commit is contained in:
parent
952dfefddc
commit
6a3f9e57d9
2
public/assets/vendor/css/core.css
vendored
2
public/assets/vendor/css/core.css
vendored
@ -20475,7 +20475,7 @@ li:not(:first-child) .dropdown-item,
|
||||
}
|
||||
/* text-size */
|
||||
.text-tiny{
|
||||
font-size: 10px;
|
||||
font-size: 13px;
|
||||
}
|
||||
/* rtl:end:remove */
|
||||
.text-primary {
|
||||
|
@ -23,22 +23,21 @@ const DatePicker = ({
|
||||
|
||||
useEffect(() => {
|
||||
if (inputRef.current) {
|
||||
const parsedMinDate = minDate ? new Date(minDate.split("T")[0]) : undefined;
|
||||
|
||||
flatpickr(inputRef.current, {
|
||||
dateFormat: "d-m-Y",
|
||||
allowInput: allowText,
|
||||
defaultDate: value ? flatpickr.parseDate(value, "Y-m-d") : null,
|
||||
maxDate: maxDate,
|
||||
minDate: parsedMinDate,
|
||||
onChange: function (selectedDates, dateStr) {
|
||||
defaultDate: value
|
||||
? flatpickr.parseDate(value, "Y-m-d")
|
||||
: null,
|
||||
maxDate:maxDate,
|
||||
minDate:new Date(minDate?.split("T")[0]) ?? null,
|
||||
onChange: (selectedDates, dateStr) => {
|
||||
onChange(dateStr);
|
||||
},
|
||||
...rest
|
||||
});
|
||||
}
|
||||
}, [inputRef, minDate, maxDate]);
|
||||
|
||||
}, [inputRef]);
|
||||
|
||||
return (
|
||||
<div className={` position-relative ${className}`}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user