How to use the react-intl.FormattedDate function in react-intl

To help you get started, we’ve selected a few react-intl 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 LLK / scratch-www / src / views / preview / mod-info.jsx View on Github external
const PropTypes = require('prop-types');
const React = require('react');
const FormattedDate = require('react-intl').FormattedDate;
const FormattedMessage = require('react-intl').FormattedMessage;
const FormattedTime = require('react-intl').FormattedTime;

const FlexRow = require('../../components/flex-row/flex-row.jsx');

require('./mod-info.scss');

const ModInfo = props => (
    
        <div>
            
        </div>
        
            {props.authorUsername &amp;&amp;
                <div>
                    {/* @todo: these profile links should be made into a shared library function */}</div>
github LLK / scratch-www / src / views / messages / message-rows / scratcher-invite.jsx View on Github external
var FormattedDate = require('react-intl').FormattedDate;
var FormattedMessage = require('react-intl').FormattedMessage;
var injectIntl = require('react-intl').injectIntl;
var React = require('react');

var Button = require('../../../components/forms/button.jsx');
var FlexRow = require('../../../components/flex-row/flex-row.jsx');

var AdminMessage = injectIntl(React.createClass({
    type: 'AdminMessage',
    propTypes: {
        id: React.PropTypes.number.isRequired,
        username: React.PropTypes.string.isRequired,
        datetimeCreated: React.PropTypes.string.isRequired,
        onDismiss: React.PropTypes.func.isRequired
    },
    render: function () {
github grommet / grommet / components / Notification.js View on Github external
_Box2.default,
          { direction: 'row', align: 'center', pad: { between: 'medium' } },
          _react2.default.createElement(_Meter2.default, {
            series: [{
              value: percentComplete,
              colorIndex: 'light-1'
            }] }),
          _react2.default.createElement(_Value2.default, { value: percentComplete, units: '%', size: 'small' })
        );
      }

      var timestampNode = void 0;
      if (timestamp) {
        var timestampFormatted = timestamp.toString();
        if (intl) {
          timestampFormatted = _react2.default.createElement(_reactIntl.FormattedDate, { value: timestamp, weekday: 'long', day: 'numeric',
            month: 'long', year: 'numeric', hour: 'numeric', minute: 'numeric',
            second: 'numeric' });
        }

        timestampNode = _react2.default.createElement(
          'div',
          { className: CLASS_ROOT + '__timestamp' },
          timestampFormatted
        );
      }

      var closerNode = void 0;
      if ((typeof closer === 'undefined' ? 'undefined' : _typeof(closer)) === 'object') {
        closerNode = closer;
      } else if (onClose && closer) {
        closerNode = _react2.default.createElement(_Button2.default, { plain: true, onClick: onClose,
github grommet / grommet / src / js / mixins / GrommetIntlMixin.js View on Github external
Intl.DateTimeFormat.supportedLocalesOf(locale)[0] === locale;
  });
}

if (! localesSupported()) {
  require('intl');
  require('intl/locale-data/jsonp/en-US.js');
  require('intl/locale-data/jsonp/pt-BR.js');
  Intl.NumberFormat = IntlPolyfill.NumberFormat;
  Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat;
}

var React = require('react');
var ReactIntl = require('react-intl');
var IntlMixin = ReactIntl.IntlMixin;
var FormattedDate = ReactIntl.FormattedDate;

module.exports = {
  mixins: [IntlMixin],

  getChildContext: function () {
    if (!this.props.locales && !this.context.locales) {
      this.context.locales = 'en-US';
    }

    if (!this.props.messages && !this.context.messages) {
      try {
        this.context.messages = require('../messages/' + (this.props.locales || this.context.locales || 'en-US'));
      } catch (e) {
        this.context.messages = require('../messages/en-US');
      }
    }
github LLK / scratch-www / src / views / preview / subactions.jsx View on Github external
const FormattedDate = require('react-intl').FormattedDate;
const FormattedMessage = require('react-intl').FormattedMessage;
const PropTypes = require('prop-types');
const React = require('react');
const FlexRow = require('../../components/flex-row/flex-row.jsx');

const Button = require('../../components/forms/button.jsx');
const AddToStudioModal = require('./add-to-studio.jsx');
const ReportModal = require('../../components/modal/report/modal.jsx');

require('./subactions.scss');

const Subactions = props =&gt; (
    
        <div>
            <div>©</div>
            {' '}</div>
github LLK / scratch-www / src / views / messages / message-rows / admin-message.jsx View on Github external
var FormattedDate = require('react-intl').FormattedDate;
var React = require('react');

var Button = require('../../../components/forms/button.jsx');
var FlexRow = require('../../../components/flex-row/flex-row.jsx');

var AdminMessage = React.createClass({
    type: 'AdminMessage',
    propTypes: {
        id: React.PropTypes.number.isRequired,
        message: React.PropTypes.string.isRequired,
        datetimeCreated: React.PropTypes.string.isRequired,
        onDismiss: React.PropTypes.func.isRequired
    },
    render: function () {
        return (
            <li></li>
github LLK / scratch-www / src / views / conference / 2020 / index / index.jsx View on Github external
const FormattedDate = require('react-intl').FormattedDate;
const FormattedMessage = require('react-intl').FormattedMessage;
const React = require('react');
const render = require('../../../../lib/render.jsx');

const FlexRow = require('../../../../components/flex-row/flex-row.jsx');
const Page = require('../../../../components/page/conference/2020/page.jsx');
const TitleBanner = require('../../../../components/title-banner/title-banner.jsx');

require('../../../../components/forms/button.scss');
require('./index.scss');

const ConferenceSplash = () =&gt; (
    <div>
        
            <div>
            <h1></h1></div></div>
github LLK / scratch-www / src / views / conference / 2017 / index / index.jsx View on Github external
var FormattedDate = require('react-intl').FormattedDate;
var FormattedMessage = require('react-intl').FormattedMessage;
var React = require('react');
var render = require('../../../../lib/render.jsx');

var FlexRow = require('../../../../components/flex-row/flex-row.jsx');
var Page = require('../../../../components/page/conference/2017/page.jsx');
var TitleBanner = require('../../../../components/title-banner/title-banner.jsx');

require('../../../../components/forms/button.scss');
require('./index.scss');

var ConferenceSplash = React.createClass({
    type: 'ConferenceSplash',

    render: function () {
        return (
github este / este / src / native / app / components / formatted.js View on Github external
children(...Children.toArray(nodes))
          :
            
          }
        
      );
    }

  };

export const FormattedDate = native(reactIntl.FormattedDate);
export const FormattedMessage = native(reactIntl.FormattedMessage);
export const FormattedNumber = native(reactIntl.FormattedNumber);
export const FormattedPlural = native(reactIntl.FormattedPlural);
export const FormattedRelative = native(reactIntl.FormattedRelative);
export const FormattedTime = native(reactIntl.FormattedTime);
github LLK / scratch-www / src / views / conference / 2019 / index / index.jsx View on Github external
const FormattedDate = require('react-intl').FormattedDate;
const FormattedMessage = require('react-intl').FormattedMessage;
const React = require('react');
const render = require('../../../../lib/render.jsx');

const FlexRow = require('../../../../components/flex-row/flex-row.jsx');
const Page = require('../../../../components/page/conference/2019/page.jsx');
const TitleBanner = require('../../../../components/title-banner/title-banner.jsx');

require('../../../../components/forms/button.scss');
require('./index.scss');

const ConferenceSplash = () =&gt; (
    <div>
        
            <div>
                <h1></h1></div></div>