How to use the react-widgets/lib/localizers/globalize function in react-widgets

To help you get started, we’ve selected a few react-widgets 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 jquense / react-formal / docs / app.jsx View on Github external
import Form from '../src';
import DateInput from '../src/inputs/Date';
import Intro from'./pages/intro.md';
import yup from 'yup';
import {
    Router
  , Route
  , IndexRoute
  , Link } from 'react-router';

import './styles/style.less';
import 'react-widgets/lib/less/react-widgets.less';

import localizers from 'react-widgets/lib/localizers/globalize'

localizers(require('globalize'))

Form.addInputTypes(types)

var nameSchema = yup.string()
      .default('')
      .required('You must provide a name');

var modelSchema = yup.object({
   name: yup.object({
     first: nameSchema,
     last:  nameSchema
   }),
   dateOfBirth: yup.date()
      .required('Please enter a date of birth')
      .max(new Date(), "You can't be born in the future!"),
github jquense / react-formal / docs / app.js View on Github external
, IndexRoute
  , Link } from 'react-router';

import '@monastic.panic/component-playground/codemirror.css';
import 'react-widgets/lib/less/react-widgets.less';
import './styles/one-light.less';
import './styles/style.less';

import localizers from 'react-widgets/lib/localizers/globalize'


import Editor from '@monastic.panic/component-playground/Editor';

Editor.defaultProps.theme ='one-light'

localizers(require('globalize'))

Form.addInputTypes(types)

var nameSchema = yup.string()
      .default('')
      .required('You must provide a name');

var modelSchema = yup.object({
   name: yup.object({
     first: nameSchema,
     last:  nameSchema
   }),
   dateOfBirth: yup.date()
      .required('Please enter a date of birth')
      .max(new Date(), "You can't be born in the future!"),