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

date-picker-riyanz

v1.1.2

Published

Date Picker with multiple selection based on Material UI

Downloads

123

Readme

Material-UI Multiple Dates Picker

Lets user pick more than one date from the date picker.

Demo

Motivation

This is a fork of @randex/material-ui-multiple-dates-picker. I needed a date picker that is built on Material-UI and supports multiple dates selections, couldn't find one, so here it is!

Features

  • Based on Material-UI components with Dialog component being the root of it
  • Choose dates right from the calendar
  • See all selected dates on the list
  • Click on any selected date to remove it (either on calendar or on the list)
  • Customize button labels and titles
  • Its appearance is based on your configuration of Material-UI theme

Installation

To install the component run this command:

npm i -S @riyansubekti/material-ui-multiple-dates-picker

Usage example

import MultipleDatesPicker from "date-picker-riyanz";

const Example = () => {
  const [open, setOpen] = useState(false);

  return (
    <div>
      <Button onClick={() => setOpen(!open)}>Select Dates</Button>
      <MultipleDatesPicker
        open={open}
        // Type : single, multi, multiple weekly, multiple monthly
        // Default Type : multi
        type="single"
        selectedDates={[]}
        onCancel={() => setOpen(false)}
        onSubmit={(dates) => console.log("selected dates", dates)}
      />
    </div>
  );
};

API

MultipleDatesPicker (default export)

| Prop Name | Type | Default | Description | | ------------------ | --------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | open | bool, required | false | Is Date Picker Dialog open or not | | type | string single, multi, weekly, monthly | multi | Single selected date, Multiple selected date, Multiple weekly selected date, Multiple monthly selected date | | selectedDates | Array of Date | [] | MultipleDatesPicker uses its own internal array of selected date and sends it only when user clicks Submit button. But you can still use this variable to pass initial value to it — array will be copied. | | disabledDates | Array of Date | null | An array of dates to disable. They will appear gray and user won't be able to select them. | | onCancel | func, required | null | Fires when user clicks Cancel button. You need to handle closing the picker when this handler fires. | | onSubmit | func, required | null | Fires when user clicks Submit button with only one parameter: array of selected Dates: onSubmit(selectedDates). You need to handle closing the picker when this handler fires. | | readOnly | bool | false | Is Date Picker interactive. Use this if you just want to display dates to the user. Submit button will be hidden and onCancel will be fired when user presses "Dismiss" button. | | cancelButtonText | string | if readOnly then "Dismiss" is not then "Cancel" | Cancel button title | | submitButtonText | string | Submit | Submit button title | | selectedDatesTitle | string | Selected Dates | Selected dates list header title |

To-Do

  • [x] Add locale support

Contributing

I don't have enough time to maintain this library, so pull requests will be greatly appreciated!

  1. Clone the repository: git clone https://github.com/riyansubekti/material-ui-multiple-dates-picker.git
  2. Get inside the folder: cd material-ui-multiple-dates-picker
  3. Install all the general dependencies: npm i
  4. Get inside the app folder: cd app
  5. Install all dependencies needed to launch the demo app: npm i
  6. Run npm start to launch the demo app.
  7. Library is located under app/src/lib. Edit the code and watch the changes in the browser.

Happy coding and thank you for your help!

Thank you : randex / material-ui-multiple-dates-picker

Thank you : sheprdinc / react-multiple-datepicker

This my first package publish npmjs