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(() => setId(value ? findTimezoneId(value) : null), [value])
|
||||
|
||||
const onValueChanged = useCallback((id: TimezoneId | null) => {
|
||||
console.log(id)
|
||||
onChange?.({
|
||||
const onValueChanged = useCallback((id: TimezoneId | null) => onChange?.({
|
||||
timezoneId: id,
|
||||
hours: id ? rawTimezones[id] : 0,
|
||||
isOverride: false,
|
||||
})
|
||||
}, [onChange])
|
||||
}), [onChange])
|
||||
|
||||
return (<Select {...other} onChange={onValueChanged} value={id} defaultValue={defaultTimezone} />)
|
||||
})
|
||||
|
@ -18,7 +18,7 @@ export const DatePickerWrapper = memo<DatePickerWrapperProps>(({ value, onChange
|
||||
format={defaultFormat}
|
||||
defaultValue={moment()}
|
||||
onChange={(date) => onChange?.(date)}
|
||||
value={isUTC ? moment.utc(value).local() : moment(value)}
|
||||
value={value && (isUTC ? moment.utc(value).local() : moment(value))}
|
||||
{...other}
|
||||
/>
|
||||
))
|
||||
|
Loading…
Reference in New Issue
Block a user