How to use the react-intl.DateTimeFormat 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 opt-out-eu / yourdigitalrights.org / src / server.js View on Github external
// Polyfill Node with `Intl` that has data for all locales.
// See: https://formatjs.io/guides/runtime-environments/#server
const IntlPolyfill = require("react-intl");
Intl.NumberFormat = IntlPolyfill.NumberFormat;
Intl.DateTimeFormat = IntlPolyfill.DateTimeFormat;

const { readFileSync } = require("fs");
const { basename } = require("path");
const express = require("express");
const accepts = require("accepts");
const glob = require("glob");
const next = require("next");
const {create} = require("bablic");
const sitemapAndRobots = require('./scripts/sitemapAndRobots')

const port = parseInt(process.env.PORT, 10) || 3000;
const dev = process.env.NODE_ENV !== "production";
const app = next({ dir: './src', dev });
const handle = app.getRequestHandler();
const url = require('url');