How to use the react-moment-proptypes.momentString.isRequired function in react-moment-proptypes

To help you get started, we’ve selected a few react-moment-proptypes 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 awethemes / awebooking / packages / scheduler / src / Schedule.js View on Github external
import React from 'react';
import PropTypes from 'prop-types';
import moment from 'moment';
import { momentString } from 'react-moment-proptypes';
import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer';
import { range } from './utils/dates';
import Calendar from './Calendar';
import Day from './Day';

export default class Schedule extends React.PureComponent {
  static propTypes = {
    startDate: momentString.isRequired,
    durations: PropTypes.number,
  };

  static defaultProps = {
    durations: 90,
  };

  constructor(props) {
    super(props);

    const {
      startDate,
      durations,
    } = this.props;

    this.state = {
github awethemes / awebooking / assets / babel / scheduler / index.jsx View on Github external
import { render } from 'react-dom'
import PropTypes from 'prop-types'
import { momentString } from 'react-moment-proptypes'
import AutoSizer from 'react-virtualized-auto-sizer'
import {
  FixedSizeGrid as Grid,
  FixedSizeList as ListA
} from 'react-window'
import DatePicker from './src/DatePicker'
import { Button, Dropdown } from '@wordpress/components'

const moment = extendMoment(Moment)

class Scheduler extends React.Component {
  static propTypes = {
    startDate: momentString.isRequired,
    durations: PropTypes.number,
  }

  static defaultProps = {
    durations: 90
  }

  constructor(props) {
    super(props)

    const {
      startDate,
      durations
    } = this.props

    const rooms = window.awebookingRoomTypes[0].rooms

react-moment-proptypes

React proptype for moment module

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis