fixed resolution

This commit is contained in:
Malini 2026-01-07 12:23:30 +05:30
parent 8ea1b44363
commit d7fe705f07
3 changed files with 11 additions and 1 deletions

View File

@ -586,6 +586,13 @@ export const DateField = ({
if (width !== 'auto') { if (width !== 'auto') {
wrapperStyle.width = typeof width === 'number' ? `${width}px` : width; 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 = { const inputStyle = {
...(baseInputStyles?.default || {}), ...(baseInputStyles?.default || {}),
...style, ...style,
@ -647,6 +654,7 @@ export const DateField = ({
style={inputStyle} style={inputStyle}
onFocus={handleFocus} onFocus={handleFocus}
onBlur={handleBlur} onBlur={handleBlur}
min={formatDateForInput(rest.minDate)}
required={required} required={required}
{...rest} {...rest}
/> />

View File

@ -989,7 +989,7 @@ const CompanyProfile = () => {
Details Details
</h4> </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 <TextField
label="Permanent Factory Code" label="Permanent Factory Code"

View File

@ -947,6 +947,7 @@ const handleSave = async () => {
} }
value={form.startDate} value={form.startDate}
required required
minDate={new Date().toISOString().split('T')[0]}
onChange={(e) => handleFormChange('startDate')(e.target.value)} onChange={(e) => handleFormChange('startDate')(e.target.value)}
placeholder="Select Date" placeholder="Select Date"
error={validationErrors.startDate} error={validationErrors.startDate}
@ -966,6 +967,7 @@ const handleSave = async () => {
} }
value={form.endDate} value={form.endDate}
required required
minDate={form.startDate || new Date().toISOString().split('T')[0]}
onChange={(e) => handleFormChange('endDate')(e.target.value)} onChange={(e) => handleFormChange('endDate')(e.target.value)}
placeholder="Select Date" placeholder="Select Date"
error={validationErrors.endDate} error={validationErrors.endDate}