New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@netojose/react-select-datepicker

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netojose/react-select-datepicker

A lightweight select date picker

  • 1.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

React Select date picker

Install

Via npm

# npm
npm install --save @netojose/react-select-datepicker

Via yarn

# yarn
yarn add @netojose/react-select-datepicker

Demo

You can see a working demo at this Sandbox

Usage

import React, { useState } from "react";
import SelectDatePicker from "@netojose/react-select-datepicker";

export default function App() {
  const [date, setDate] = useState(new Date(2000, 0, 1));
  const handleChange = value => setDate(value);
  return (
    <div>
      <SelectDatePicker value={date} onDateChange={handleChange} />

      <p>Chosen date: {date.toString()}</p>
    </div>
  );
}

Available Props

PropTypeDescriptionDefaultOptions
valueDateCurrent input valueREQUIRED-
minDateDateMinimum date allowednew Date(1900, 0, 1)-
maxDateDateMaximum date allowednew Date()-
classNamestringWrapper class namenull-
cssstringcss functionnull-
onDateChangefunconChange date triggerREQUIRED-
showErrorsbooleanShow or not error messagetruetrue, false
showLabelsbooleanShow or not input labelstruetrue, false
yearLabelbooleanYear label textYearAny string
monthLabelbooleanMonth label textMonthAny string
dayLabelbooleanDay label textDayAny string
errorFormatstringFormat error message'Invalid date'Any string
errorMinstringError min value message'Date must be greater than allowed'Any string
errorMaxstringError max value message'Date must be less than allowed'Any string
formatstringInputs position'month/day/year''day/month/year', 'day/year/month', 'month/day/year', 'month/year/day', 'year/month/day', 'year/day/month'
monthNamesarrayArray with month names['January', ..., 'December']An array with 12 strings

Notes

Year Select Field
  • If no minDate is provided than the minium year that can be selected is 1900
  • If no maxDate is provided than the maxium year that can be selected is the current
CSS in js integration
  • The className prop can be useful to extend the component using Styled-components
  • The css prop can be useful to extend the component using Emotion

License

MIT © netojose

Keywords

FAQs

Package last updated on 02 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc