Sha256: 2dc9ff3a5018fda4b3ece3d887ab53d79e963ba53cb8d6ad282fc205647b8c95

Contents?: true

Size: 830 Bytes

Versions: 8

Compression:

Stored size: 830 Bytes

Contents

import extend from '../utils/extend';
import { createUTC } from './utc';

export function isValid(m) {
    if (m._isValid == null) {
        m._isValid = !isNaN(m._d.getTime()) &&
            m._pf.overflow < 0 &&
            !m._pf.empty &&
            !m._pf.invalidMonth &&
            !m._pf.nullInput &&
            !m._pf.invalidFormat &&
            !m._pf.userInvalidated;

        if (m._strict) {
            m._isValid = m._isValid &&
                m._pf.charsLeftOver === 0 &&
                m._pf.unusedTokens.length === 0 &&
                m._pf.bigHour === undefined;
        }
    }
    return m._isValid;
}

export function createInvalid (flags) {
    var m = createUTC(NaN);
    if (flags != null) {
        extend(m._pf, flags);
    }
    else {
        m._pf.userInvalidated = true;
    }

    return m;
}

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
date_picker-0.0.6 test/dummy/vendor/assets/components/moment/src/lib/create/valid.js
date_picker-0.0.5 test/dummy/vendor/assets/components/moment/src/lib/create/valid.js
date_picker-0.0.4 test/dummy/vendor/assets/components/moment/src/lib/create/valid.js
date_picker-0.0.3 test/dummy/vendor/assets/components/moment/src/lib/create/valid.js
date_picker-0.0.2 test/dummy/vendor/assets/components/moment/src/lib/create/valid.js
date_picker-0.0.1 test/dummy/vendor/assets/components/moment/src/lib/create/valid.js
puppet-herald-0.8.1 lib/puppet-herald/public/bower_components/moment/src/lib/create/valid.js
puppet-herald-0.8.0 lib/puppet-herald/public/bower_components/moment/src/lib/create/valid.js