Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@paprika/calendar

Package Overview
Dependencies
Maintainers
4
Versions
118
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paprika/calendar

Calendar component

latest
Source
npmnpm
Version
5.0.2
Version published
Maintainers
4
Created
Source

Calendar

This package consists of two components (SingleDateCalendar and DateRangeCalendar) providing calendar views but with difference that SingleDateCalendar allows selecting only one exact date and DateRangeCalendar allows selection range of dates.

Installation

npm install --save @paprika/calendar

or

yarn add @paprika/calendar

Usage

Please use <L10n /> component to wrap calendar components or you application.

SingleDateCalendar

import SingleDateCalendar from "@paprika/calendar/lib/SingleDateCalendar";
// alternative (but has potential problems with tree-shaking):
// import { SingleDateCalendar } from "@paprika/calendar";

const [date, setDate] = React.useState(null);
const [possibleDate, setPossibleDate] = React.useState(null);

<SingleDateCalendar
  date={date}
  onSelect={setDate}
  possibleDate={possibleDate}
  resetPossibleDate={() => {
    setPossibleDate(null);
  }}
/>;

DateRangeCalendar

import DateRangeCalendar from "@paprika/calendar/lib/DateRangeCalendar";
// alternative (but has potential problems with tree-shaking):
// import { DateRangeCalendar } from "@paprika/calendar";
import { START_DATE } from "@paprika/calendar/lib/tokens";

const [currentInput, setCurrentInput] = React.useState(START_DATE);
const [{ startDate, endDate }, setDates] = React.useState({ startDate: null, endDate: null });
const [possibleDate, setPossibleDate] = React.useState(null);

<DateRangeCalendar
  startDate={startDate}
  endDate={endDate}
  onDatesChange={setDates}
  possibleDate={possibleDate}
  resetPossibleDate={() => {
    setPossibleDate(null);
  }}
  focusedInput={currentInput || START_DATE}
  onFocusChange={setCurrentInput}
/>;

Props

SingleDateCalendar

  • date (required)
  • onSelect (required)
  • possibleDate
  • resetPossibleDate

DateRangeCalendar

  • startDate (required)
  • endDate (required)
  • onDatesChange (required)
  • possibleDate
  • resetPossibleDate
  • focusedInput (required)
  • onFocusChange (required)

FAQs

Package last updated on 29 Mar 2025

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