MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / createLocalOrUTC

Function createLocalOrUTC

tests/test_code/js/moment/moment.js:2993–3022  ·  view source on GitHub ↗
(input, format, locale, strict, isUTC)

Source from the content-addressed store, hash-verified

2991 }
2992
2993 function createLocalOrUTC(input, format, locale, strict, isUTC) {
2994 var c = {};
2995
2996 if (format === true || format === false) {
2997 strict = format;
2998 format = undefined;
2999 }
3000
3001 if (locale === true || locale === false) {
3002 strict = locale;
3003 locale = undefined;
3004 }
3005
3006 if (
3007 (isObject(input) && isObjectEmpty(input)) ||
3008 (isArray(input) && input.length === 0)
3009 ) {
3010 input = undefined;
3011 }
3012 // object construction must be done this way.
3013 // https://github.com/moment/moment/issues/1423
3014 c._isAMomentObject = true;
3015 c._useUTC = c._isUTC = isUTC;
3016 c._l = locale;
3017 c._i = input;
3018 c._f = format;
3019 c._strict = strict;
3020
3021 return createFromConfig(c);
3022 }
3023
3024 function createLocal(input, format, locale, strict) {
3025 return createLocalOrUTC(input, format, locale, strict, false);

Callers 2

createUTCFunction · 0.85
createLocalFunction · 0.85

Calls 4

isObjectFunction · 0.85
isObjectEmptyFunction · 0.85
isArrayFunction · 0.85
createFromConfigFunction · 0.85

Tested by

no test coverage detected