fixed resolution
This commit is contained in:
parent
8ea1b44363
commit
d7fe705f07
@ -586,6 +586,13 @@ export const DateField = ({
|
||||
if (width !== 'auto') {
|
||||
wrapperStyle.width = typeof width === 'number' ? `${width}px` : width;
|
||||
}
|
||||
// Format the minDate prop if provided
|
||||
const formatDateForInput = (dateString) => {
|
||||
if (!dateString) return '';
|
||||
const date = new Date(dateString);
|
||||
return date.toISOString().split('T')[0];
|
||||
};
|
||||
|
||||
const inputStyle = {
|
||||
...(baseInputStyles?.default || {}),
|
||||
...style,
|
||||
@ -647,6 +654,7 @@ export const DateField = ({
|
||||
style={inputStyle}
|
||||
onFocus={handleFocus}
|
||||
onBlur={handleBlur}
|
||||
min={formatDateForInput(rest.minDate)}
|
||||
required={required}
|
||||
{...rest}
|
||||
/>
|
||||
|
||||
@ -989,7 +989,7 @@ const CompanyProfile = () => {
|
||||
Details
|
||||
</h4>
|
||||
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
<div className="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-4 gap-4 items-start">
|
||||
|
||||
<TextField
|
||||
label="Permanent Factory Code"
|
||||
|
||||
@ -947,6 +947,7 @@ const handleSave = async () => {
|
||||
}
|
||||
value={form.startDate}
|
||||
required
|
||||
minDate={new Date().toISOString().split('T')[0]}
|
||||
onChange={(e) => handleFormChange('startDate')(e.target.value)}
|
||||
placeholder="Select Date"
|
||||
error={validationErrors.startDate}
|
||||
@ -966,6 +967,7 @@ const handleSave = async () => {
|
||||
}
|
||||
value={form.endDate}
|
||||
required
|
||||
minDate={form.startDate || new Date().toISOString().split('T')[0]}
|
||||
onChange={(e) => handleFormChange('endDate')(e.target.value)}
|
||||
placeholder="Select Date"
|
||||
error={validationErrors.endDate}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user