Sha256: 6193038859b18d6324861dd3c66a9090321c741c30ffb06335cf15615baf4731

Contents?: true

Size: 876 Bytes

Versions: 19

Compression:

Stored size: 876 Bytes

Contents

import { formattingTokens } from '../format/format';

export var defaultLongDateFormat = {
    LTS: 'h:mm:ss A',
    LT: 'h:mm A',
    L: 'MM/DD/YYYY',
    LL: 'MMMM D, YYYY',
    LLL: 'MMMM D, YYYY h:mm A',
    LLLL: 'dddd, MMMM D, YYYY h:mm A',
};

export function longDateFormat(key) {
    var format = this._longDateFormat[key],
        formatUpper = this._longDateFormat[key.toUpperCase()];

    if (format || !formatUpper) {
        return format;
    }

    this._longDateFormat[key] = formatUpper
        .match(formattingTokens)
        .map(function (tok) {
            if (
                tok === 'MMMM' ||
                tok === 'MM' ||
                tok === 'DD' ||
                tok === 'dddd'
            ) {
                return tok.slice(1);
            }
            return tok;
        })
        .join('');

    return this._longDateFormat[key];
}

Version data entries

19 entries across 19 versions & 1 rubygems

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