Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

materialui-daterange-picker

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

materialui-daterange-picker

A react date range picker implementation using @material-ui.

  • 1.1.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4.4K
decreased by-9.04%
Maintainers
1
Weekly downloads
 
Created
Source

Material UI DateRange Picker

A react date range picker implementation using @material-ui.

Latest npm version

Live Demo

Check out the project running at https://pedro-lb.github.io/materialui-daterange-picker/

Usage

npm install materialui-daterange-picker --save

# or with yarn
yarn add materialui-daterange-picker

Screenshot

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
initialDateRangeDateRange{}initially selected date range
minDate`Datestring`10 years ago
maxDate`Datestring`10 years from now
definedRangesDefinedRange[]-custom defined ranges to show in the list
definedRangesDefinedRange[]-custom defined ranges to show in the list
closeOnClickOutsidebooleantruedefines if DateRangePicker will be closed when clicking outside of it
wrapperClassNameobjectdefines additional wrapper classes

Keywords

FAQs

Package last updated on 28 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc