PHP Classes

File: vendors/moment/src/lib/create/valid.js

Recommend this page to a friend!
  Classes of Jorge Castro   Gentelella BladeOne   vendors/moment/src/lib/create/valid.js   Download  
File: vendors/moment/src/lib/create/valid.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Gentelella BladeOne
Render templates using Bootstrap for presentation
Author: By
Last change:
Date: 3 years ago
Size: 1,206 bytes
 

Contents

Class file image Download
import extend from '../utils/extend'; import { createUTC } from './utc'; import getParsingFlags from '../create/parsing-flags'; import some from '../utils/some'; export function isValid(m) { if (m._isValid == null) { var flags = getParsingFlags(m); var parsedParts = some.call(flags.parsedDateParts, function (i) { return i != null; }); m._isValid = !isNaN(m._d.getTime()) && flags.overflow < 0 && !flags.empty && !flags.invalidMonth && !flags.invalidWeekday && !flags.nullInput && !flags.invalidFormat && !flags.userInvalidated && (!flags.meridiem || (flags.meridiem && parsedParts)); if (m._strict) { m._isValid = m._isValid && flags.charsLeftOver === 0 && flags.unusedTokens.length === 0 && flags.bigHour === undefined; } } return m._isValid; } export function createInvalid (flags) { var m = createUTC(NaN); if (flags != null) { extend(getParsingFlags(m), flags); } else { getParsingFlags(m).userInvalidated = true; } return m; }