1.2.0 • Published 5 years ago

preact-calendar v1.2.0

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

preact-calendar

Installation

npm install preact-calendar -S

This is how it looks

Screenshot

Usage

Code Example:

import Calendar from "preact-calendar";

function onDateSelect(date) {
  console.log("You clicked: ", date);
}

render(
  <Calendar minDate={new Date('2019-01-01')} disablePast={true} onSelect={this.getSelectedDate()} highlightSecondFourthSatdays={true}
    highlightSundays={true} highlightToday={true}/>,
  document.body
);

(Do not forget to give proportionate height and width to parent element)

Options

Properties used to customise the rendering:

NameTypeDescription
minDateDateThe date from which to start the Calendar
disablePastBooleanWhen true, disables the selection of dates before Today
onSelectfunctionCallback function, called on selecting a date
highlightSundaysBooleanWhen true, highlights all Sundays with red color (defaults: false)
highlightTodayBooleanWhen true, today's date is highlighted by default (defaults: false)
highlightSecondFourthSatdaysBooleanWhen true, highlights second & fourth Saturday in each month (defaults: false)
1.2.0

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.0

5 years ago