@carbon/react
Version:
React components for the Carbon Design System
20 lines (19 loc) • 1.02 kB
TypeScript
/**
* Copyright IBM Corp. 2019, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { type Config } from 'flatpickr/dist/plugins/rangePlugin';
import { Instance } from 'flatpickr/dist/types/instance';
/**
* @param config Plugin configuration.
* @returns An extension of Flatpickr `rangePlugin` that does the following:
* * Better ensures the calendar dropdown is always aligned to the `<input>` for the starting date.
* Workaround for: https://github.com/flatpickr/flatpickr/issues/1944
* * A logic to ensure `fp.setDate()` call won't end up with "startDate to endDate" set to the first `<input>`
*/
export declare const rangePlugin: (config?: Config) => (fp: Instance) => Partial<import("flatpickr/dist/types/options").BaseOptions> & {
onReady: (import("flatpickr/dist/types/options").Hook | import("flatpickr/dist/types/options").Hook[] | undefined)[];
onPreCalendarPosition: () => void;
};