1.2.6 • Published 4 years ago

materialui-daterange-picker-bck v1.2.6

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Material UI DateRange Picker

Fork of materialui-daterange-picker A react date range picker implementation using @material-ui.

Preview

Screenshot

Live Demo

Check out the project running here!

Usage

npm install materialui-daterange-picker-bck --save

# or with yarn
yarn add materialui-daterange-picker-bck

Basic example

import React from "react";
import { DateRangePicker, DateRange } from "materialui-daterange-picker";

type Props = {}

const App: React.FunctionComponent<Props> = props => {
  const [open, setOpen] = React.useState(false);
  const [dateRange, setDateRange] = React.useState<DateRange>({});

  const toggle = () => setOpen(!open);

  return (
    <DateRangePicker
      open={open}
      toggle={toggle}
      onChange={(range) => setDateRange(range)}
    />
  );
}

export default App;

Types

interface DateRange {
    startDate?: Date,
    endDate?: Date
}

interface DefinedRange {
    label: string,
    startDate: Date,
    endDate: Date
}

Props

NameTypeRequiredDefault valueDescription
onChange(DateRange) => voidrequired-handler function for providing selected date range
toggle() => voidrequired-function to show / hide the DateRangePicker
initialDateRangeDateRangeoptional{}initially selected date range
minDateDate or stringoptional10 years agomin date allowed in range
maxDateDate or stringoptional10 years from nowmax date allowed in range
definedRangesDefinedRange[]optional-custom defined ranges to show in the list
closeOnClickOutsidebooleanoptionaltruedefines if DateRangePicker will be closed when clicking outside of it
wrapperClassNameobjectoptionalundefineddefines additional wrapper style classes

Made possible by

1.2.6

4 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3-d

4 years ago

1.2.3-c

4 years ago

1.2.3-b

4 years ago

1.2.3-a

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.99

4 years ago

1.1.98

4 years ago

1.1.97

4 years ago

1.1.96

4 years ago

1.1.95

4 years ago

1.1.94

4 years ago

1.1.93

4 years ago

1.1.92

4 years ago