Reputation: 11
I am using react-admin and want to edit date and time including seconds using DateTimeInput. However, I am not able to do that. I tried following:
Option 1:
<TextField
id={id}
{...input}
step='1'
value={format(input.value) || ''}
variant={variant}
error={!!(touched && (error || submitError))}
helperText={<InputHelperText touched={touched ?? false} error={error || submitError} helperText={helperText} />}
label={<FieldTitle label={label} source={source} resource={resource} isRequired={isRequired} />}
{...options}
{...sanitizeInputRestProps(rest)}
/>
Option 2:
<DateTimeInput label='Scratched Time' source='scratched_time' disabled={!scratched} />
But, I am not able to edit the seconds field.
Upvotes: 0
Views: 4751
Reputation: 21
Try to put "step" inside "inputProps" instead. ;-)
<TextField
inputProps={{
"step": 1,
}}
type="datetime-local"
/>
Upvotes: 1