Skip to content

A date range picker component built with React and moment.js

Notifications You must be signed in to change notification settings

mhsiungw/date-range-picker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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;

About

A date range picker component built with React and moment.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published