Sha256: fb8d969904303f3fdb88cc109e9e5667a694a4add22df06a334dfcbbaf436d42

Contents?: true

Size: 1.16 KB

Versions: 25

Compression:

Stored size: 1.16 KB

Contents

import { getLocale } from './locales';
import { createUTC } from '../create/utc';

function get (format, index, field, setter) {
    var locale = getLocale();
    var utc = createUTC().set(setter, index);
    return locale[field](utc, format);
}

function list (format, index, field, count, setter) {
    if (typeof format === 'number') {
        index = format;
        format = undefined;
    }

    format = format || '';

    if (index != null) {
        return get(format, index, field, setter);
    }

    var i;
    var out = [];
    for (i = 0; i < count; i++) {
        out[i] = get(format, i, field, setter);
    }
    return out;
}

export function listMonths (format, index) {
    return list(format, index, 'months', 12, 'month');
}

export function listMonthsShort (format, index) {
    return list(format, index, 'monthsShort', 12, 'month');
}

export function listWeekdays (format, index) {
    return list(format, index, 'weekdays', 7, 'day');
}

export function listWeekdaysShort (format, index) {
    return list(format, index, 'weekdaysShort', 7, 'day');
}

export function listWeekdaysMin (format, index) {
    return list(format, index, 'weekdaysMin', 7, 'day');
}

Version data entries

25 entries across 25 versions & 5 rubygems

Version Path
active_record_survey_api-0.0.19 spec/test_app/vendor/assets/bower_components/moment/src/lib/locale/lists.js
active_record_survey_api-0.0.18 spec/test_app/vendor/assets/bower_components/moment/src/lib/locale/lists.js
active_record_survey_api-0.0.17 spec/test_app/vendor/assets/bower_components/moment/src/lib/locale/lists.js
active_record_survey_api-0.0.14 spec/test_app/vendor/assets/bower_components/moment/src/lib/locale/lists.js
active_record_survey_api-0.0.12 spec/test_app/vendor/assets/bower_components/moment/src/lib/locale/lists.js
locomotivecms-3.2.0.rc1 vendor/assets/components/locomotive_sources/moment/src/lib/locale/lists.js
locomotivecms-3.1.1 vendor/assets/components/locomotive_sources/moment/src/lib/locale/lists.js
locomotivecms-3.1.0 vendor/assets/components/locomotive_sources/moment/src/lib/locale/lists.js
active_record_survey_api-0.0.11 spec/test_app/vendor/assets/bower_components/moment/src/lib/locale/lists.js
locomotivecms-3.1.0.rc3 vendor/assets/components/locomotive_sources/moment/src/lib/locale/lists.js
locomotivecms-3.1.0.rc2 vendor/assets/components/locomotive_sources/moment/src/lib/locale/lists.js
locomotivecms-3.1.0.rc1 vendor/assets/components/locomotive_sources/moment/src/lib/locale/lists.js
active_record_survey_api-0.0.7 spec/test_app/vendor/assets/bower_components/moment/src/lib/locale/lists.js
active_record_survey_api-0.0.6 spec/test_app/vendor/assets/bower_components/moment/src/lib/locale/lists.js
date_picker-0.0.8 test/dummy/vendor/assets/components/moment/src/lib/locale/lists.js
date_picker-0.0.7 test/dummy/vendor/assets/components/moment/src/lib/locale/lists.js
sedge_cms-0.0.1 vendor/assets/components/moment/src/lib/locale/lists.js
date_picker-0.0.6 test/dummy/vendor/assets/components/moment/src/lib/locale/lists.js
date_picker-0.0.5 test/dummy/vendor/assets/components/moment/src/lib/locale/lists.js
date_picker-0.0.4 test/dummy/vendor/assets/components/moment/src/lib/locale/lists.js