Skip to content

Latest commit

 

History

History
44 lines (31 loc) · 688 Bytes

README.md

File metadata and controls

44 lines (31 loc) · 688 Bytes

date-range-picker

Live site

https://mhsiungw.github.io/date-range-picker/

Installation

To start the project

npm i
npm run dev

To run tests

npm test

Usage

Here’s a basic example of how to use the date-range-picker component:

import React, { useState } from "react";
import DateRangePicker from "date-range-picker";

const App = () => {
  const [range, setRange] = useState([]);

  return (
    <div>
      <h1>Select a Date Range</h1>
      <DateRangePicker onChange={setRange} />
      <div>Start: {range[0]?.format() || "--"}</div>
      <div>End: {range[1]?.format() || "--"}</div>
    </div>
  );
};

export default App;