(config)
| 17277 | } |
| 17278 | |
| 17279 | function prepareConfig (config) { |
| 17280 | var input = config._i, |
| 17281 | format = config._f; |
| 17282 | |
| 17283 | config._locale = config._locale || getLocale(config._l); |
| 17284 | |
| 17285 | if (input === null || (format === undefined && input === '')) { |
| 17286 | return createInvalid({nullInput: true}); |
| 17287 | } |
| 17288 | |
| 17289 | if (typeof input === 'string') { |
| 17290 | config._i = input = config._locale.preparse(input); |
| 17291 | } |
| 17292 | |
| 17293 | if (isMoment(input)) { |
| 17294 | return new Moment(checkOverflow(input)); |
| 17295 | } else if (isDate(input)) { |
| 17296 | config._d = input; |
| 17297 | } else if (isArray(format)) { |
| 17298 | configFromStringAndArray(config); |
| 17299 | } else if (format) { |
| 17300 | configFromStringAndFormat(config); |
| 17301 | } else { |
| 17302 | configFromInput(config); |
| 17303 | } |
| 17304 | |
| 17305 | if (!isValid(config)) { |
| 17306 | config._d = null; |
| 17307 | } |
| 17308 | |
| 17309 | return config; |
| 17310 | } |
| 17311 | |
| 17312 | function configFromInput(config) { |
| 17313 | var input = config._i; |
no test coverage detected