1.0.18 ā€¢ Published 3 years ago

dates-picker v1.0.18

Weekly downloads
18
License
-
Repository
github
Last release
3 years ago

Example Image

Demo

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

  • 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

PropertyTypeAllowed ValuesDefault ValueDescription
languageStringEnglish, HebrewEnglishcomponent's language. currently support English and Hebrew. Notice Languages such Hebrew changes the whole component from left to right to right to left.
colorsPaletteStringenabled, disabledenabledby enabling colors palette you can choose the component's color.
formatStringany combination of 2 Ds, 2 Ms and 2\4 Ys with otherDD-MM-YYYYthe format of the dates.
selectAllButtonStringenabled, disabledenableddepends on current board's view (dates, months, or years), select all enabled items.
startDatedatedate objectnew Date(1900, 0, 0)calendar's start date.
endDatedatedate objectnew Date(2025, 0, 0)calendar's end date.
firstDayOfWeekIndexint0 - 60 (sunday)first day of the week (etc monday, sunday).
pickMethodStringdate, range, rangesrangedate 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).
defaultColorStringany color format item#2196f3default component's color. becomes the first option on colors palette.
daysAmountTabStringenabled, disableddisabledby enabling, there will be a button on the left that you can open and choose prepared range, or days amount up to today.
boardsNumint1, 22by 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
1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.9

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago