1.2.5 • Published 2 years ago

datepicker-library-oc v1.2.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

datepicker-library-oc

A simple datepicker made with React

NPM JavaScript Style Guide

Install

npm install --save datepicker-library-oc

Usage

All available props are shown in the next section. To get a selected date's value, you need a function that will return it, or put it in your state. You can then call that function in the onChange prop.

import React, { Component } from "react";

import DatePicker from "datepicker-library-oc";
import "datepicker-library-oc/dist/index.css";

function Example() {
  const [date, setDate] = useState("");
  const handleChange = (selectedDate) => {
    setDate(selectedDate);
  };

  return <DatePicker onChange={handleChange} />;
}

Props

PropTypeDefault value
onChangeFunctionReturn null. Should be present in every datepicker component with a function as a value
inputIconBooleanfalse
closeButtonBooleantrue
highlightTodayBooleantrue
langString"en" (also available for now : "fr")
startYearNumbernull (or current year)
startMonthNumbernull (or current month index). The month index goes from 0 (january) to 11 (december).

Examples

All examples can be found on https://louannem.github.io/datepicker-library-oc/

License

MIT © louannem

1.2.5

2 years ago

1.2.4

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.4

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago