PHP Classes

File: vendors/gentelella/vendors/moment/src/lib/moment/constructor.js

Recommend this page to a friend!
  Classes of Jorge Castro   Gentelella BladeOne   vendors/gentelella/vendors/moment/src/lib/moment/constructor.js   Download  
File: vendors/gentelella/vendors/moment/src/lib/moment/constructor.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,991 bytes
 

Contents

Class file image Download
import { hooks } from '../utils/hooks'; import hasOwnProp from '../utils/has-own-prop'; import isUndefined from '../utils/is-undefined'; import getParsingFlags from '../create/parsing-flags'; // Plugins that add properties should also add the key here (null value), // so we can properly clone ourselves. var momentProperties = hooks.momentProperties = []; export function copyConfig(to, from) { var i, prop, val; if (!isUndefined(from._isAMomentObject)) { to._isAMomentObject = from._isAMomentObject; } if (!isUndefined(from._i)) { to._i = from._i; } if (!isUndefined(from._f)) { to._f = from._f; } if (!isUndefined(from._l)) { to._l = from._l; } if (!isUndefined(from._strict)) { to._strict = from._strict; } if (!isUndefined(from._tzm)) { to._tzm = from._tzm; } if (!isUndefined(from._isUTC)) { to._isUTC = from._isUTC; } if (!isUndefined(from._offset)) { to._offset = from._offset; } if (!isUndefined(from._pf)) { to._pf = getParsingFlags(from); } if (!isUndefined(from._locale)) { to._locale = from._locale; } if (momentProperties.length > 0) { for (i in momentProperties) { prop = momentProperties[i]; val = from[prop]; if (!isUndefined(val)) { to[prop] = val; } } } return to; } var updateInProgress = false; // Moment prototype object export function Moment(config) { copyConfig(this, config); this._d = new Date(config._d != null ? config._d.getTime() : NaN); // Prevent infinite loop in case updateOffset creates new moment // objects. if (updateInProgress === false) { updateInProgress = true; hooks.updateOffset(this); updateInProgress = false; } } export function isMoment (obj) { return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); }