npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@8x8/oxygen-calendar

v3.0.0

Published

Oxygen - Calendar

Readme

8x8 Oxygen - Calendar

Installation

$ yarn add @8x8/oxygen-calendar
$ npm install @8x8/oxygen-calendar

Usage

import Calendar, { Month, Day, Styled } from '@8x8/oxygen-calendar';
<Calendar
  range={range}
  onRangeChange={this.onRangeChange}
  date={date}
  onDateChange={this.onDateChange}
  months={2}
  showMonthYearPickers
  minDate={addYears(new Date(), -1)}
  maxDate={addYears(new Date(), 1)}
  displayMode="dateRange"
/>
<Month month={new Date()} dateOptions={{ weekStartsOn: 1 }} />
<Month
  month={addMonths(Date.now(), 1)}
  showMonthName
  showWeekDays={false}
  displayMode="dateRange"
  range={range2}
  preview={preview4}
  minDate={addDays(new Date(), -18)}
/>
<Day
  day={addDays(new Date(), -4)}
  range={range}
  preview={preview}
  displayMode="dateRange"
  isToday
/>
<Day day={addDays(new Date(), 4)} preview={preview} isToday />

l10n

import deLocale from 'date-fns/locale/de';

<Calendar
  range={range}
  onRangeChange={this.onRangeChange}
  date={date}
  onDateChange={this.onDateChange}
  locale={deLocale}
/>

<Month
  month={addMonths(Date.now(), 1)}
  showMonthName
  displayMode="dateRange"
  range={range2}
  preview={preview4}
  locale={deLocale}
/>

<Day day={addDays(new Date(), 4)} preview={preview} locale={deLocale} />

Disabled Date Tooltips

// Custom tooltip messages for disabled dates
const disabledDateTooltip = date => {
  if (date < minDate) {
    return 'Date is before the minimum allowed date';
  }
  if (date > maxDate) {
    return 'Date is after the maximum allowed date';
  }
  // Check if date is a holiday
  if (isHoliday(date)) {
    return 'This date is unavailable - public holiday';
  }
  return undefined; // No tooltip
};

<Calendar
  range={range}
  onRangeChange={this.onRangeChange}
  minDate={minDate}
  maxDate={maxDate}
  disabledDateTooltip={disabledDateTooltip}
  displayMode="dateRange"
/>;

Available styled components

  • DayCell
  • SelectionRange
  • PreviewRange
  • DayNumber
  • TodayLine
  • MonthGrid
  • MonthName
  • WeekDays
  • WeekDay
  • CalendarWrapper
  • MonthWrapper
  • MonthSeparator
  • MonthYearPickers
  • MonthYearPicker
  • CalendarMonthNavigation

Props

Calendar

| Name | Type | Default | Description | | -------------------- | ----------------------------------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | testId | string | 'CALENDAR' | Test ID DOM attribute value | | showMonthArrow | bool | true | Show the next and previous month selector arrows | | showMonthYearPickers | bool | true | Show the month and year selector dropdown | | months | number | 2 | The number of visible month grids | | dateOptions | object | { weekStartsOn: 0, customEvenMonths: false } | Date options based on date-fns, for example: { weekStartsOn: 1 } plus custom option regarding even month rows between multiple Months: { customEvenMonths: true } | | defaultFocusedDate | object | undefined | Default date to which the calendar will render. If there is a date or date range set, the calendar will be rendered to the selected date/start date of the range. If there is no selection then the calendar will render the date received on defaultFocusedDate prop or the current date if the prop is not received | | disabledDates | array | [] | An array with the disabled dates (Date objects). Also, this overrides the enabledDates prop | | enabledDates | array | [] | An array containing the only dates which will be enabled (Date objects) | | minDate | object | addYears(new Date(), -100) | The minimum date to show and select in Calendar | | maxDate | object | addYears(new Date(), 20) | The maximum date to show and select in Calendar | | displayMode | oneOf(['date', 'dateRange']) | 'date' | The date selection/preview and display mode | | showPreview | bool | true | Show the preview and the range preview (for 'dateRange' display mode) | | dayNumberFormat | string | 'd' | The formatting option for the day numbers in Month grid. The complete list of values can be found: https://date-fns.org/v2.28.0/docs/format | | weekDayDisplayFormat | string | 'EE' | The way how the week days are formatted. The complete list of values can be found: https://date-fns.org/v2.28.0/docs/format | | monthDisplayFormat | string | 'MMMM yyyy' | The way how the month names are formatted. The complete list of values can be found: https://date-fns.org/v2.28.0/docs/format | | focusedMonthFormat | string | 'MMMM' | The format of the month name in Month selector dropdown. The complete list of values can be found: https://date-fns.org/v2.28.0/docs/format | | focusedYearFormat | string | 'yyyy' | The format of the year in Year selector dropdown. The complete list of values can be found: https://date-fns.org/v2.28.0/docs/format | | locale | object | undefined | Defines the locale options and strings (e.g. day or month names) used to format date values. Works with locale definitions from date-fns: https://date-fns.org/v2.28.0/docs/I18n en is the built-in, default language, doesn't require any setup. | | range | shape({ startDate: object*, endDate: object }) | | The selected date range (only for 'dateRange' display mode) | | onRangeChange | func | undefined | Callback function called when the user changes the selected date range (only for 'dateRange' display mode) | | date | object | | The selected date (only for 'date' display mode) | | onDateChange | func | undefined | Callback function called when the user changes the selected date (only for 'date' display mode) | | onPreviewChange | func | undefined | Callback function executed after the preview range changes | | disabledDateTooltip | (day: Date) => string \| undefined | undefined | Callback function that returns a tooltip message for disabled dates. The function receives the date as a parameter and should return a string message to display in the tooltip, or undefined to show no tooltip. Only displays tooltips for disabled dates (isDisabled is true). | | theme | Partial<CalendarTheme> | | Overrides applied on top of the light or dark settings resolved by OxygenProvider |

Month

| Name | Type | Default | Description | | -------------------- | ----------------------------------------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | month* | object | | The month to show (represented by a Date object) | | testId | string | 'CALENDAR_MONTH' | Test ID DOM attribute value | | dateOptions | object | { weekStartsOn: 0 } | Date options based on date-fns, for example: { weekStartsOn: 1 } | | disabledDates | array | [] | An array with the disabled dates (Date objects) | | minDate | object | | The minimum date to show and select in Month | | maxDate | object | | The maximum date to show and select in Month | | displayMode | oneOf(['date', 'dateRange']) | 'date' | The date selection/preview and display mode | | showPreview | bool | true | Show the preview and the range preview (for 'dateRange' display mode) | | preview | shape({ startDate: object, endDate: object }) | | The preview range/interval to display | | range | shape({ startDate: object*, endDate: object }) | | The selected date range (only for 'dateRange' display mode) | | date | object | | The selected date (only for 'date' display mode) | | dayNumberFormat | string | 'd' | The formatting option for the day numbers in Month grid. The complete list of values can be found: https://date-fns.org/v2.28.0/docs/format | | showWeekDays | bool | true | Show the weekday (ex. Mon, Tue, Wed...) in the top of the Month grid | | weekDayDisplayFormat | string | 'EE' | The way how the week days are formatted. The complete list of values can be found: https://date-fns.org/v2.28.0/docs/format | | showMonthName | bool | false | Show the month name (ex. February 2018) in the of the Month Grid | | monthDisplayFormat | string | 'MMMM yyyy' | The way how the month names are formatted. The complete list of values can be found: https://date-fns.org/v2.28.0/docs/format | | locale | object | undefined | Defines the locale options and strings (e.g. day or month names) used to format date values. Works with locale definitions from date-fns: https://date-fns.org/v2.28.0/docs/I18n en is the built-in, default language, doesn't require any setup | | onDayClick | func | undefined | Callback function executed when a Day is clicked in the Month grid. Function called with the Date object of the clicked Day | | onPreviewChange | func | undefined | Callback function executed when the preview range should be changed (on mouse and keyboard focus events). Function called with the hovered/focused day, or with undefined if no day is hovered/focused. | | theme | Partial<CalendarTheme> | | Overrides applied on top of the light or dark settings resolved by OxygenProvider |

Day

| Name | Type | Default | Description | | ------------------- | ----------------------------------------------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | day* | object | | The day to show (represented by a Date object) | | testId | string | 'CALENDAR_DAY | Test ID DOM attribute value | | displayMode | oneOf(['date', 'dateRange']) | 'date' | The date selection/preview and display mode | | preview | shape({ startDate: object, endDate: object }) | | The preview range/interval to display | | range | shape({ startDate: object*, endDate: object }) | | The selected date range (only for 'dateRange' display mode) | | date | object | | The selected date (only for 'date' display mode) | | isPassive | bool | false | Is passive: used to visualize days from the next/previous month to complete the current month grid | | isDisabled | bool | false | Is disabled | | isToday | bool | false | Is today | | isWeekend | bool | false | Is weekend | | isStartOfWeek | bool | false | Is start of month | | isEndOfWeek | bool | false | Is end of week | | isStartOfMonth | bool | false | Is start of month | | isEndOfMonth | bool | false | Is end of month | | dayNumberFormat | string | 'd' | The formatting option for the day numbers. The complete list of values can be found: https://date-fns.org/v2.28.0/docs/format | | locale | object | undefined | Defines the locale options and strings (e.g. day or month names) used to format date values. Works with locale definitions from date-fns: https://date-fns.org/v2.28.0/docs/I18n en is the built-in, default language, doesn't require any setup | | onClick | func | undefined | Callback function executed when a day is clicked or a focused date is submitted using Enter or Space key | | onPreviewChange | func | undefined | Callback function executed when the preview range should be changed (on mouse and keyboard focus events). Function called with the hovered/focused day, or with undefined if no day is hovered/focused. | | disabledDateTooltip | (day: Date) => string \| undefined | undefined | Callback function that returns a tooltip message for disabled dates. The function receives the date as a parameter and should return a string message to display in the tooltip, or undefined to show no tooltip. Only displays tooltips for disabled dates (isDisabled is true). | | theme | Partial<CalendarTheme> | | Overrides applied on top of the light or dark settings resolved by OxygenProvider |

Props marked with * are required