import { jsx as _jsx } from "react/jsx-runtime";
import { DatePicker, parseAbsoluteDate } from '@cube-dev/ui-kit';
import { useCallback, useMemo } from 'react';
const MIN_DATE_VALUE = parseAbsoluteDate('1980-01-01');
export function TimeDateSelector(props) {
    const { value, onChange } = props;
    const onChangeHandler = useCallback((val) => {
        onChange(val.toString().split(/[+\]]/)[0]);
    }, [onChange]);
    const dateValue = useMemo(() => parseAbsoluteDate(value), [value]);
    return (_jsx(DatePicker, { "aria-label": "Date picker", size: "small", minValue: MIN_DATE_VALUE, defaultValue: dateValue, onChange: onChangeHandler }));
}
//# sourceMappingURL=TimeDateSelector.js.map