🐛 fix: Add step attribute to datetime-local inputs for precise time selection in forms
This commit is contained in:
parent
5816dd5198
commit
32fd181b52
@ -225,6 +225,7 @@ export default function AdsForm<T extends Record<string, any>>({
|
||||
<FormControl>
|
||||
<EnhancedInput
|
||||
type='datetime-local'
|
||||
step='1'
|
||||
placeholder={t('form.enterStartTime')}
|
||||
value={field.value ? new Date(field.value).toISOString().slice(0, 16) : ''}
|
||||
min={Number(new Date().toISOString().slice(0, 16))}
|
||||
@ -253,6 +254,7 @@ export default function AdsForm<T extends Record<string, any>>({
|
||||
<FormControl>
|
||||
<EnhancedInput
|
||||
type='datetime-local'
|
||||
step='1'
|
||||
placeholder={t('form.enterEndTime')}
|
||||
value={
|
||||
field.value ? new Date(field.value).toISOString().slice(0, 16) : ''
|
||||
|
||||
@ -366,6 +366,7 @@ export default function EmailBroadcastForm() {
|
||||
<FormControl>
|
||||
<EnhancedInput
|
||||
type='datetime-local'
|
||||
step='1'
|
||||
disabled={form.watch('scope') === 5} // ScopeSkip
|
||||
value={field.value}
|
||||
onValueChange={field.onChange}
|
||||
@ -384,6 +385,7 @@ export default function EmailBroadcastForm() {
|
||||
<FormControl>
|
||||
<EnhancedInput
|
||||
type='datetime-local'
|
||||
step='1'
|
||||
disabled={form.watch('scope') === 5} // ScopeSkip
|
||||
value={field.value}
|
||||
onValueChange={field.onChange}
|
||||
@ -425,6 +427,7 @@ export default function EmailBroadcastForm() {
|
||||
<FormControl>
|
||||
<EnhancedInput
|
||||
type='datetime-local'
|
||||
step='1'
|
||||
placeholder={t('leaveEmptyForImmediateSend')}
|
||||
value={field.value}
|
||||
onValueChange={field.onChange}
|
||||
|
||||
@ -269,6 +269,7 @@ export default function QuotaBroadcastForm() {
|
||||
<FormControl>
|
||||
<EnhancedInput
|
||||
type='datetime-local'
|
||||
step='1'
|
||||
value={field.value}
|
||||
onValueChange={field.onChange}
|
||||
/>
|
||||
@ -286,6 +287,7 @@ export default function QuotaBroadcastForm() {
|
||||
<FormControl>
|
||||
<EnhancedInput
|
||||
type='datetime-local'
|
||||
step='1'
|
||||
value={field.value}
|
||||
onValueChange={field.onChange}
|
||||
/>
|
||||
|
||||
@ -79,8 +79,18 @@ export default function DynamicMultiplier() {
|
||||
<div className='space-y-4 pt-4'>
|
||||
<ArrayInput<API.TimePeriod>
|
||||
fields={[
|
||||
{ name: 'start_time', prefix: t('server_config.fields.start_time'), type: 'time' },
|
||||
{ name: 'end_time', prefix: t('server_config.fields.end_time'), type: 'time' },
|
||||
{
|
||||
name: 'start_time',
|
||||
prefix: t('server_config.fields.start_time'),
|
||||
type: 'time',
|
||||
step: '1',
|
||||
},
|
||||
{
|
||||
name: 'end_time',
|
||||
prefix: t('server_config.fields.end_time'),
|
||||
type: 'time',
|
||||
step: '1',
|
||||
},
|
||||
{
|
||||
name: 'multiplier',
|
||||
prefix: t('server_config.fields.multiplier'),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user