New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

itf-react-datepicker

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

itf-react-datepicker

A date picker designed for the ITF website

latest
Source
npmnpm
Version
0.1.6
Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

ITF React Datepicker

The datepicker developed for the ITF Website, check out the DEMO

Install and usage

Install it

yarn add itf-react-datepicker

Then use it

import React, { useState } from "react";
import DatePickerITF from "./DatePicker";

// add css - up to you how you do this
import '~/node_modules/itf-react-datepicker/dist/main.css';

const DatePickerExample = (props) => {
  const { initialStartDate, initialEndDate } = props;
  const [startDate, setStartDate] = useState<Date | null>(null);
  const [endDate, setEndDate] = useState<Date | null>(null);

  return (
    <DatePickerITF
      startDate={startDate}
      endDate={endDate}
      onDateChange={(startDate, endDate) => {
        setStartDate(startDate);
        setEndDate(endDate);
      }}
    />
  );
};

Props

Yo, this datepicker needs a wrapper that holds the state of the start and end dates. This gives you the flexibility to change the selected dates from your own code e.g. in a reset dates button.

Here are the props:

proptypedescription
startDateDateThe start date
endDateDateThe end date
onDateChange`(startDate: Datenull, endDate: Date
disabled?booleanis it disabled on not, duh
bemModifier?stringa class for the datepicker, if you want it
elementId?stringan id for the datepicker, if you want it

You should hold the state for startDate and endDate in your wrapper component and update it with onDateChange.

Let me know what you think in the issues!

Keywords

react

FAQs

Package last updated on 21 Feb 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