Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 = (
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,