This commit is contained in:
hamid zarghami
2025-01-26 08:57:06 +03:30
parent be994782da
commit bfb9f3cbcb
6 changed files with 107 additions and 11 deletions
+10 -5
View File
@@ -4,6 +4,7 @@ import persian from 'react-date-object/calendars/persian';
import persian_fa from 'react-date-object/locales/persian_fa';
import DateObject from 'react-date-object';
import CalenderIcon from '../assets/images/calendar.svg'
import { clx } from '../helpers/utils';
type Props = {
onChange: (date: string) => void;
@@ -13,7 +14,7 @@ type Props = {
reset?: boolean;
isDateTime?: boolean;
className?: string;
label: string
label?: string
};
const DatePickerComponent: FC<Props> = (props: Props) => {
@@ -45,10 +46,14 @@ const DatePickerComponent: FC<Props> = (props: Props) => {
return (
<div className="w-full">
<div className='text-sm'>
{props.label}
</div>
<div className='relative mt-1.5'>
{props.label &&
<div className='text-sm'>
{props.label}
</div>}
<div className={clx(
'relative ',
props.label && 'mt-1.5'
)}>
<DatePicker
placeholder={props.placeholder}
value={value}