How to use the moment.localeData function in moment

To help you get started, we’ve selected a few moment 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 elastic / eui / src-docs / src / components / guide_locale_selector / guide_locale_selector.js View on Github external
import React from 'react';
import PropTypes from 'prop-types';

import moment from 'moment';
import { translateUsingPseudoLocale } from '../../../src/services/string/pseudo_locale_translator';

// For testing/demoing EuiDatePicker, process moment's `en` locale config into a babelfished version
const enConfig = moment.localeData('en')._config;
moment.defineLocale('en-xa', {
  ...enConfig,
  months: enConfig.months.map(translateUsingPseudoLocale),
  monthsShort: enConfig.monthsShort.map(translateUsingPseudoLocale),
  weekdays: enConfig.weekdays.map(translateUsingPseudoLocale),
  weekdaysMin: enConfig.weekdaysMin.map(translateUsingPseudoLocale),
  weekdaysShort: enConfig.weekdaysShort.map(translateUsingPseudoLocale),
});
// Reset default moment locale after using `defineLocale`
moment.locale('en');

import { EuiSwitch, EuiFormRow } from '../../../../src/components';

export const GuideLocaleSelector = ({ selectedLocale, onToggleLocale }) => {
  return (
github moodlehq / moodlemobile2 / src / providers / utils / time.ts View on Github external
getLocalizedDateFormat(localizedFormat: any): string {
        return moment.localeData().longDateFormat(localizedFormat);
    }
github nuxeo / nuxeo-elements / ui / widgets / nuxeo-date-picker.js View on Github external
value() {
            return (
              (Nuxeo.UI && Nuxeo.UI.config && parseInt(Nuxeo.UI.config.firstDayOfWeek, 10)) ||
              moment.localeData().firstDayOfWeek() ||
              0
            );
          },
          observer: '_firstDayOfWeekChanged',
github cerner / terra-framework / packages / terra-date-picker / src / react-datepicker / date_utils.js View on Github external
export function getLocaleDataForLocale (locale) {
  return moment.localeData(locale)
}
github OpusCapita / react-grid / src / datagrid / date-picker / date-picker.component.jsx View on Github external
      { getFirstDayOfWeek: () => moment.localeData().firstDayOfWeek() },
    );
github signumsoftware / framework / Signum.React / Scripts / ConfigureReactWidgets.ts View on Github external
firstOfWeek: function firstOfWeek(culture: string) {
      return (moment.localeData(culture) as any).firstDayOfWeek();
    },
github HireVue / hv-react-calendar / modules / HvReactCalendar.jsx View on Github external
i18n: function() {
      return moment.localeData(this.props.locale) ||
             moment.localeData(defaultProps.locale);
  },
github airbnb / react-dates / src / components / DayPickerRangeController.jsx View on Github external
isLastDayOfWeek(day) {
    const { firstDayOfWeek } = this.props;
    return day.day() === ((firstDayOfWeek || moment.localeData().firstDayOfWeek()) + 6) % 7;
  }
github y0c / react-datepicker / src / components / DayView.tsx View on Github external
public render() {
    const { current, locale } = this.props;

    const dayMatrix = getDayMatrix(current.year(), current.month());
    const weekdays = moment.localeData(locale).weekdaysShort();

    return (
       (
          
        )}
      />