import { Icon } from "@blueprintjs/core"; import { DateInput, DateInputProps, DateRange, DateRangeInput, DateRangeInputProps } from "@blueprintjs/datetime"; import { makeDNP } from "@services/roam"; import { CustomClasses } from "../../constants"; const popoverProps: DateInputProps["popoverProps"] = { canEscapeKeyClose: false, fill: true, minimal: true, placement: "bottom", popoverClassName: [CustomClasses.POPOVER, CustomClasses.DATE_PICKER].join(" ") }; const staticProps: Pick = { formatDate: (date/*, locale */) => makeDNP(date, { brackets: false }), parseDate: (str) => new Date(str) }; type InputDateSingleProps = { value: Date, setValue: NonNullable }; function InputDateSingle({ value, setValue }: InputDateSingleProps) { return } shortcuts={false} value={value} {...staticProps} />; } type InputDateRangeProps = { value: DateRange, setValue: NonNullable }; function InputDateRange({ value, setValue }: InputDateRangeProps) { return ; } export { InputDateSingle, InputDateRange };