How to use the react-day-picker.LocaleUtils 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 DefinitelyTyped / DefinitelyTyped / react-day-picker / react-day-picker-tests.tsx View on Github external
function MyComponent() {
   return 
}
DayPicker2.DateUtils.clone(new Date());
github blablacar / ui-library / src / datePicker / DatePicker.unit.tsx View on Github external
describe('renderCaption', () => {
    const currentYear = new Date().getFullYear()
    const datepicker = shallow()
    const captionProps: Partial = {
      date: new Date(currentYear, 0, 1),
      localeUtils: {
        ...DayPicker.LocaleUtils,
        formatMonthTitle: datepicker.instance().formatMonthTitle,
      },
    }
    it('Should render the given month title', () => {
      const caption = renderer.create(datepicker.instance().renderCaption(captionProps))
      expect(caption).toMatchSnapshot()
    })
    it('Should render the given month title with year if it is not the current year', () => {
      const futureYearProps = { ...captionProps, date: new Date(2050, 0, 1) }
      const caption = renderer.create(datepicker.instance().renderCaption(futureYearProps))
      expect(caption).toMatchSnapshot()
    })
  })
github blablacar / ui-library / src / datePicker / DatePicker.tsx View on Github external
const defaultWeekdaysLong = [0, 1, 2, 3, 4, 5, 6].map(weekday =>
  DayPicker.LocaleUtils.formatWeekdayLong(weekday),
)
github blablacar / ui-library / src / datePicker / DatePicker.tsx View on Github external
const defaultWeekdaysShort = [0, 1, 2, 3, 4, 5, 6].map(weekday =>
  DayPicker.LocaleUtils.formatWeekdayShort(weekday),
)
github bufferapp / buffer-components / InputDate / InputDateWeekday / story.jsx View on Github external
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
import { checkA11y } from 'storybook-addon-a11y';
import Weekday from './index';
import DayPicker from 'react-day-picker';

const localeUtils = DayPicker.LocaleUtils;

storiesOf('InputDateWeekdays', module)
  .addDecorator(checkA11y)
  .add('Short Weekday', () => (
    
  ))
  .add('Medium Weekday', () => (
    
  ))
  .add('Long Weekday', () => (
    
  ));