forked from ddrilling/asb_cloud_front
* Вывод в консоль скрыт в TimezoneSelect
* Добавлена обработка falsy значений в DatePickerWrapper
This commit is contained in:
parent
905036cc71
commit
6d833c75c5
@ -37,14 +37,11 @@ export const TimezoneSelect = memo<TimezoneSelectProps>(({ onChange, value, defa
|
|||||||
useEffect(() => setDefaultTimezone(defaultValue ? findTimezoneId(defaultValue) : null), [defaultValue])
|
useEffect(() => setDefaultTimezone(defaultValue ? findTimezoneId(defaultValue) : null), [defaultValue])
|
||||||
useEffect(() => setId(value ? findTimezoneId(value) : null), [value])
|
useEffect(() => setId(value ? findTimezoneId(value) : null), [value])
|
||||||
|
|
||||||
const onValueChanged = useCallback((id: TimezoneId | null) => {
|
const onValueChanged = useCallback((id: TimezoneId | null) => onChange?.({
|
||||||
console.log(id)
|
timezoneId: id,
|
||||||
onChange?.({
|
hours: id ? rawTimezones[id] : 0,
|
||||||
timezoneId: id,
|
isOverride: false,
|
||||||
hours: id ? rawTimezones[id] : 0,
|
}), [onChange])
|
||||||
isOverride: false,
|
|
||||||
})
|
|
||||||
}, [onChange])
|
|
||||||
|
|
||||||
return (<Select {...other} onChange={onValueChanged} value={id} defaultValue={defaultTimezone} />)
|
return (<Select {...other} onChange={onValueChanged} value={id} defaultValue={defaultTimezone} />)
|
||||||
})
|
})
|
||||||
|
@ -18,7 +18,7 @@ export const DatePickerWrapper = memo<DatePickerWrapperProps>(({ value, onChange
|
|||||||
format={defaultFormat}
|
format={defaultFormat}
|
||||||
defaultValue={moment()}
|
defaultValue={moment()}
|
||||||
onChange={(date) => onChange?.(date)}
|
onChange={(date) => onChange?.(date)}
|
||||||
value={isUTC ? moment.utc(value).local() : moment(value)}
|
value={value && (isUTC ? moment.utc(value).local() : moment(value))}
|
||||||
{...other}
|
{...other}
|
||||||
/>
|
/>
|
||||||
))
|
))
|
||||||
|
Loading…
Reference in New Issue
Block a user