Giter VIP home page Giter VIP logo

almogtavor / date-range-picker Goto Github PK

View Code? Open in Web Editor NEW
102.0 4.0 16.0 2.52 MB

โš›๏ธ๐Ÿ“† Flexible React date range picker calendar with no dependencies.

Home Page: https://almogtavor.github.io/date-range-picker/

License: MIT License

HTML 1.50% CSS 12.98% JavaScript 85.52%
reactjs react-hooks react-component javascript picker-calendar range-picker calendar dependency-less react

date-range-picker's Introduction


NPM

โš›๏ธ๐Ÿ“† Flexible React date range picker calendar with no dependencies



Example Image

Demo

Demo page at https://almogtavor.github.io/date-range-picker/

Read More

Main Features

  • Pick method - an option of configuring the component to be date picker, range picker, or ranges picker.
  • Days amount tab - an option of selecting a number of days backward from the current date immediately by choosing a number.
  • Colors palette - an option of determining the component's color (can be disabled removed).
  • Language - English and Hebrew support.
  • Select all button - an option of selecting all of the current board's dates. Whether viewing dates, months, or years.
  • Boards number - an option of configuring components to be in one board or two boards.

Installation

$ npm i dates-picker

Usage

function callbackFunction(dates) {
    console.log(`The range of dates that got picked is: ${dates.text}`);
    console.log(`The min date that got picked is: ${dates.minDate}`);
    console.log(`The max date that got picked is: ${dates.maxDate}`);
    console.log(`The number of days that got picked is: ${dates.numberOfDaysPicked}`);
    console.log(`All dates: ${dates.allDates}`);
}

function MyComponent() {
    return (
      <DateRangePicker 
        callback={callbackFunction}
      />
    )
  }
}

Options

Property Type Allowed Values Default Value Description
language String English, Hebrew English component's language. currently support English and Hebrew. Notice Languages such Hebrew changes the whole component from left to right to right to left.
colorsPalette String enabled, disabled enabled by enabling colors palette you can choose the component's color.
format String any combination of 2 Ds, 2 Ms and 2\4 Ys with other DD-MM-YYYY the format of the dates.
selectAllButton String enabled, disabled enabled depends on current board's view (dates, months, or years), select all enabled items.
startDate date date object new Date(1900, 0, 0) calendar's start date.
endDate date date object new Date(2025, 0, 0) calendar's end date.
firstDayOfWeekIndex int 0 - 6 0 (sunday) first day of the week (etc monday, sunday).
pickMethod String date, range, ranges range date means picking one day (on one board). range is to peak dates two dates. ranges is to pick an array of ranges (with view option on hover).
defaultColor String any color format item #2196f3 default component's color. becomes the first option on colors palette.
daysAmountTab String enabled, disabled disabled by enabling, there will be a button on the left that you can open and choose prepared range, or days amount up to today.
boardsNum int 1, 2 2 by specifing you can choose the component's boards number.

Future Plans

  • Add simple and intuitive time picker option (by list\ or visual clock\ both).
  • Tooltips for buttons explanation (for example on select all button).
  • On non-component-screen click, close component.
  • Go back button on non-dates mode (or on all modes for previous). When the user is in month's or year's mode, add an option to return to dates mode without choosing any value.
  • Component & button sizes parameters
  • Border radius parameter
  • An option to cancel picked range from the input label

date-range-picker's People

Contributors

almogtavor avatar lgtm-migrator avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

date-range-picker's Issues

Fix dependencies, update demo project.

Most of the "dependencies" should be "peerDependencies" and/or worked around directly. gh-pages in particular should be a "devDependency" .. your demo/gh-pages should really have its' own directory/package.json and be part of .npmignore so they aren't in the final distribution.

How to import this in our file?

'DateRangePicker' is not defined react/jsx-no-undef

This was the error when i used in my react js.

I installed it correctly though.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.