Sha256: 37e90ac837fb700557e90e3e6f916db33ff5362ca3ddba4a3032c14220a8e103

Contents?: true

Size: 946 Bytes

Versions: 19

Compression:

Stored size: 946 Bytes

Contents

import { getLocale } from '../locale/locales';
import { deprecate } from '../utils/deprecate';

// If passed a locale key, it will set the locale for this
// instance.  Otherwise, it will return the locale configuration
// variables for this instance.
export function locale(key) {
    var newLocaleData;

    if (key === undefined) {
        return this._locale._abbr;
    } else {
        newLocaleData = getLocale(key);
        if (newLocaleData != null) {
            this._locale = newLocaleData;
        }
        return this;
    }
}

export var lang = deprecate(
    'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.',
    function (key) {
        if (key === undefined) {
            return this.localeData();
        } else {
            return this.locale(key);
        }
    }
);

export function localeData() {
    return this._locale;
}

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
card-mod-date-0.15.6 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.15.0 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.14.2 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.14.1 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.14.0 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.13.4 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.13.3 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.13.2 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.13.1 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.13.0 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.11.7 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.12.0 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.11.6 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.11.5 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.11.4 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.11.3 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.11.2 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.11.1 vendor/moment/src/lib/moment/locale.js
card-mod-date-0.11.0 vendor/moment/src/lib/moment/locale.js