1.0.10 • Published 3 years ago

itpc-react-calendar v1.0.10

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

Calendar

Calendar for your React app.

  • Pick days, months, years

Getting started

Installation

  • Install by executing npm install itpc-react-calendar or yarn add itpc-react-calendar.

Usage

  • Import by adding import Calendar from 'itpc-react-calendar'.
  • Use by adding <Calendar />. Use onChangeDate prop for getting new values.

Here's an example of basic usage:

import React, { useState } from 'react';
import Calendar from 'Calendar';

function MyApp() {
  const [value, onChange] = useState(new Date());
  
  const onChangeDate = (value: string) => {
    onChange(value)
  } 
  
  return (
    <div>
      <Calendar
        onChangeDate={onChangeDate}
        currentValue="2021-01-01"
      />
    </div>
  );
}

User guide

Calendar

Displays a complete, interactive calendar.

Props

Prop nameTypeDescriptionDefault valueExample values
currentValuestringFormat date: YYYY-MM-DDtoday'2000-01-01'
offsetYearnumberThe parameter is the display of years. Before and after the current year1010
showbooleanIf true, then the element is visible, otherwise hiddenfalsetrue
onChangeDate(date: string)voidTakes in the value of the selected date

License

The MIT License.

1.0.10

3 years ago

1.0.9

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

1.0.0

3 years ago