Sha256: 30f826b46e3cee50558fc18211735a310fb31b6b9349ae1dd8b600f63f1e6b9d

Contents?: true

Size: 978 Bytes

Versions: 8

Compression:

Stored size: 978 Bytes

Contents

import { daysInMonth } from '../units/month';
import { YEAR, MONTH, DATE, HOUR, MINUTE, SECOND, MILLISECOND } from '../units/constants';

export default function checkOverflow (m) {
    var overflow;
    var a = m._a;

    if (a && m._pf.overflow === -2) {
        overflow =
            a[MONTH]       < 0 || a[MONTH]       > 11  ? MONTH :
            a[DATE]        < 1 || a[DATE]        > daysInMonth(a[YEAR], a[MONTH]) ? DATE :
            a[HOUR]        < 0 || a[HOUR]        > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR :
            a[MINUTE]      < 0 || a[MINUTE]      > 59  ? MINUTE :
            a[SECOND]      < 0 || a[SECOND]      > 59  ? SECOND :
            a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND :
            -1;

        if (m._pf._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) {
            overflow = DATE;
        }

        m._pf.overflow = overflow;
    }

    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/check-overflow.js
date_picker-0.0.5 test/dummy/vendor/assets/components/moment/src/lib/create/check-overflow.js
date_picker-0.0.4 test/dummy/vendor/assets/components/moment/src/lib/create/check-overflow.js
date_picker-0.0.3 test/dummy/vendor/assets/components/moment/src/lib/create/check-overflow.js
date_picker-0.0.2 test/dummy/vendor/assets/components/moment/src/lib/create/check-overflow.js
date_picker-0.0.1 test/dummy/vendor/assets/components/moment/src/lib/create/check-overflow.js
puppet-herald-0.8.1 lib/puppet-herald/public/bower_components/moment/src/lib/create/check-overflow.js
puppet-herald-0.8.0 lib/puppet-herald/public/bower_components/moment/src/lib/create/check-overflow.js