mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-02-16 05:11:10 -05:00
🐛 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>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
placeholder={t('form.enterStartTime')}
|
placeholder={t('form.enterStartTime')}
|
||||||
value={field.value ? new Date(field.value).toISOString().slice(0, 16) : ''}
|
value={field.value ? new Date(field.value).toISOString().slice(0, 16) : ''}
|
||||||
min={Number(new Date().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>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
placeholder={t('form.enterEndTime')}
|
placeholder={t('form.enterEndTime')}
|
||||||
value={
|
value={
|
||||||
field.value ? new Date(field.value).toISOString().slice(0, 16) : ''
|
field.value ? new Date(field.value).toISOString().slice(0, 16) : ''
|
||||||
|
|||||||
@ -366,6 +366,7 @@ export default function EmailBroadcastForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
disabled={form.watch('scope') === 5} // ScopeSkip
|
disabled={form.watch('scope') === 5} // ScopeSkip
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
@ -384,6 +385,7 @@ export default function EmailBroadcastForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
disabled={form.watch('scope') === 5} // ScopeSkip
|
disabled={form.watch('scope') === 5} // ScopeSkip
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
@ -425,6 +427,7 @@ export default function EmailBroadcastForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
placeholder={t('leaveEmptyForImmediateSend')}
|
placeholder={t('leaveEmptyForImmediateSend')}
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
|
|||||||
@ -269,6 +269,7 @@ export default function QuotaBroadcastForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
/>
|
/>
|
||||||
@ -286,6 +287,7 @@ export default function QuotaBroadcastForm() {
|
|||||||
<FormControl>
|
<FormControl>
|
||||||
<EnhancedInput
|
<EnhancedInput
|
||||||
type='datetime-local'
|
type='datetime-local'
|
||||||
|
step='1'
|
||||||
value={field.value}
|
value={field.value}
|
||||||
onValueChange={field.onChange}
|
onValueChange={field.onChange}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -79,8 +79,18 @@ export default function DynamicMultiplier() {
|
|||||||
<div className='space-y-4 pt-4'>
|
<div className='space-y-4 pt-4'>
|
||||||
<ArrayInput<API.TimePeriod>
|
<ArrayInput<API.TimePeriod>
|
||||||
fields={[
|
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',
|
name: 'multiplier',
|
||||||
prefix: t('server_config.fields.multiplier'),
|
prefix: t('server_config.fields.multiplier'),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user