0.5.1 • Published 2 years ago

date-range-calendar v0.5.1

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

date-range-calendar

A calendar and date/date-range picker for react.

Dependencies

  • dayjs
  • styled-components

Setup

npm i date-range-calendar

GitHub

https://github.com/Brian-1150/date-range-calendar

Code Examples

Default calendar with no props:

import { Calendar } from 'date-range-calendar';

function App() {
  return (
    <Calendar />
  );
}
export default App;

Pass props to customize colors:

import { Calendar } from 'date-range-calendar';

function App() {
  return (
    <Calendar
      bgColor='#e0ffff'
      startBgColor='#228b22'
      endBgColor='#ab4e52'
      rangeColor='#faf0be'
    />
  );
}
export default App;

Pass set functions to receive start and end date values:

import React, { useState } from 'react';
import { Calendar } from 'date-range-calendar';

function App() {
  const [startDate, startDateSet] = useState('');
  const [endDate, endDateSet] = useState('');

  return (
    <div style={{padding: '2%'}}>

      <div style={{border: '1px solid black', padding: '5%', margin: '2%'}}>
        <div>Start Date: {startDate}</div>
        <div>End Date: {endDate}</div>
      </div>
    <div>
            <Calendar

        startSet={startDateSet}
        endSet={endDateSet}
        />
    </div>
        </div>
  );
}
export default App;

Options

0.5.1

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.1

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.1.1

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago