How to use the react-day-picker/lib/src/DayPicker.propTypes function in react-day-picker

To help you get started, we’ve selected a few react-day-picker examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OpusCapita / react-dates / src / client / components / DayPicker / DayPicker.react.js View on Github external
render() {
    let {
      className,
      dayPickerRef,
      isRange,
      hideTodayButton,
      onChange, // eslint-disable-line no-unused-vars
      getTodayButtonLabel,
      locale,
      pickerClassName,
      ...restProps
    } = this.props;

    let { monthToDisplay } = this.state;

    let splittedProps = splitProps(restProps, Object.keys(ReactDayPicker.propTypes));
    let commonProps = splittedProps[0];
    let pickerSpecificProps = splittedProps[1];

    let todayButton = hideTodayButton ? null : (
      <button tabindex="{-1}" type="button">
        {getTodayButtonLabel(locale)}
      </button>
    );

    let caption = (
github OpusCapita / react-dates / src / client / components / DayPicker / DayPicker.react.js View on Github external
import PropTypes from 'prop-types';
import React, { Component } from 'react';
import ReactDayPicker from 'react-day-picker/lib/src/DayPicker';
import "react-day-picker/lib/style.css";
import localeUtils from '../../dayjs/reactDayPickerUtils';
import getMessage from '../translations';
import { splitProps, zeroTime } from '../utils';
import Caption from './Caption.react';
import dayjs from 'dayjs';
import './DayPicker.less';

let propTypes = {
  ...ReactDayPicker.propTypes,
  className: PropTypes.string,
  dayPickerRef: PropTypes.func,
  getTodayButtonLabel: PropTypes.func,
  hideTodayButton: PropTypes.bool,
  isRange: PropTypes.bool,
  onChange: PropTypes.func,
  pickerClassName: PropTypes.string
};

let defaultProps = {
  className: '',
  dayPickerRef: () => {},
  getTodayButtonLabel: (locale) => getMessage(locale, 'today'),
  hideTodayButton: false,
  isRange: false,
  labels: ReactDayPicker.defaultProps.labels,