npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-range-calendar

v1.0.3

Published

A responsive and accessible date range picker component built with React

Downloads

123

Readme

react-range-calendar :calendar:

A responsive and accessible date range picker component with bunch of options built with React :fire:

NPM JavaScript Style Guide

Demo & Features (click here)

| range | free-range | single | | :-------------------------------------------------------------: | :-------------------------------------------------------------: | :-------------------------------------------------------------: | | | | |

Install

npm install --save react-range-calendar

OR

yarn add react-range-calendar

Usage

import React, { Component } from "react";
import Calendar from "react-range-calendar";

export default class App extends Component {
  state = {
    visible: true,
    dateRange: [new Date("11/10/2019"), new Date("11/18/2019")]
  };

  render() {
    const { visible, dateRange } = this.state;
    const steps = 7;
    const startWithDay = "Wed";

    return (
      <Calendar
        visible={visible}
        steps={steps}
        startWithDay={startWithDay}
        dateRange={dateRange}
        onDateClick={(minDate, maxDate) => {
          this.setState({ dateRange: [minDate, maxDate] });
        }}
        type="range"
      />
    );
  }
}

Common Props

Asterisk (*) props are Required.

| Prop name | Description | Default Value | Example values | | :------------------: | :---------------------------------------------------: | :-----------: | :------------------------------------------------: | | type* | Types of calendar ["free-range", "single", "range"] | "range" | "free-range" | | visible* | Visibility of calendar | false | true | | dateRange* | Array of starting and ending dates | [] | [new Date("11/10/2019"), new Date("11/18/2019")] | | onDateClick* | On clicking any date | | (minDate, maxDate)=>{} | | baseColor | Base color | #007bff | red | | fontColor | Font Color | | `white` | | hoverBackgroundColor | Hover background color | `#007bff` | `red` | | hoverFontColor | Hover Font Color | | white | | disabledColor | Disabled color | #add8e6 | #b9b9b9 | | weekDaysColor | Week Days Color | `` | #ff7b7b | | weekendsDaysColor | Weekends color | grey | #ffbaba |

Types

  1. range

    On user date selection, it will find nearest provided day (startWithDay) and add provided steps from that day

    Example

    <Calendar
      visible={visible}
      steps={steps}
      startWithDay={startWithDay}
      dateRange={dateRange}
      onDateClick={(minDate, maxDate) => {
        this.setState({ dateRange: [minDate, maxDate] });
      }}
      type="range"
    />

    Demo

    Props

    | Prop name | Description | Default Value | Example values | | :------------: | :-----------------------------------: | :-----------: | :------------: | | steps* | Steps from start date | 7 | 7 | | startWithDay* | Starting day of nearest selected date | Wed | Wed |

  2. free-range

    Users can select date freely

    Example

    <Calendar
      visible={visible}
      dateRange={dateRange}
      onDateClick={(minDate, maxDate) => {
        this.setState({ dateRange: [minDate, maxDate] });
      }}
      type="free-range"
    />

    Demo

  3. single

    For single date select

    Example

    <Calendar
      visible={visible}
      dateRange={dateRange}
      onDateClick={date => {
        this.setState({ dateRange: [date] });
      }}
      type="single"
    />

    Demo

Contributors ✨

Thanks goes to these wonderful people

Pull Requests

Feel free to make Pull Request for your feature/fix.

License

MIT © Expertizo