1.1.4 • Published 2 years ago

custom-calendar-vs v1.1.4

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

Custom_calendar_vs

Custom react calendar with date and range selection

Built with React 17.0.X and Rollup 2.X

Dependencies moment.js

Before you continue

Custom-calendar-vs is under constant development.

Installation

Add the Calendar to your project by executing npm install custom-calendar-vs .

Usage

Example of basic code:

import React, { useState } from "react";
import moment from "moment";
import { Calendar } from "../components/Calendar/Calendar";

export const App = () => {
  const [selectedDate, setSelectedDate] = useState(moment());
  return (
    <Calendar
      setSelectedDate={(e) => setSelectedDate(e)}
      format="range"
      size="sm"
      dayFormat="normal"
    />
  );
};

Check the repo for the code base.

Props

Prop nameDescriptionDefault valueUsage
formatChooses type of date selection: single/range"single"format = "single"/ format = "range"
setSelecedDateCall back returning the choosen dates(in moment) as per the format(Moment())=>setSelectedDate(Moment()) format = "single" =>> (date)=>setSelectedDate(date) -> return moment() format = "range" =>> (date)=>setSelectedDate(date) -> returns [moment(),moment(),....]
sizeSize of the calendar"md"size = "sm" / size = "md" / size = "lg"
dayFormatDisplays the day name in single/three letter format"normal"dayFormat = "normal" / dayFormat = "short"
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.0

2 years ago