aboutsummaryrefslogtreecommitdiffstats
path: root/bower_components/moment/src/lib/create
diff options
context:
space:
mode:
Diffstat (limited to 'bower_components/moment/src/lib/create')
-rw-r--r--bower_components/moment/src/lib/create/from-anything.js23
-rw-r--r--bower_components/moment/src/lib/create/from-string.js6
-rw-r--r--bower_components/moment/src/lib/create/valid.js1
3 files changed, 17 insertions, 13 deletions
diff --git a/bower_components/moment/src/lib/create/from-anything.js b/bower_components/moment/src/lib/create/from-anything.js
index 4b836c0..5a69dc5 100644
--- a/bower_components/moment/src/lib/create/from-anything.js
+++ b/bower_components/moment/src/lib/create/from-anything.js
@@ -14,9 +14,19 @@ import { configFromArray } from './from-array';
import { configFromObject } from './from-object';
function createFromConfig (config) {
+ var res = new Moment(checkOverflow(prepareConfig(config)));
+ if (res._nextDay) {
+ // Adding is smart enough around DST
+ res.add(1, 'd');
+ res._nextDay = undefined;
+ }
+
+ return res;
+}
+
+export function prepareConfig (config) {
var input = config._i,
- format = config._f,
- res;
+ format = config._f;
config._locale = config._locale || getLocale(config._l);
@@ -40,14 +50,7 @@ function createFromConfig (config) {
configFromInput(config);
}
- res = new Moment(checkOverflow(config));
- if (res._nextDay) {
- // Adding is smart enough around DST
- res.add(1, 'd');
- res._nextDay = undefined;
- }
-
- return res;
+ return config;
}
function configFromInput(config) {
diff --git a/bower_components/moment/src/lib/create/from-string.js b/bower_components/moment/src/lib/create/from-string.js
index 4bd6d59..4a7163b 100644
--- a/bower_components/moment/src/lib/create/from-string.js
+++ b/bower_components/moment/src/lib/create/from-string.js
@@ -36,14 +36,14 @@ export function configFromISO(config) {
getParsingFlags(config).iso = true;
for (i = 0, l = isoDates.length; i < l; i++) {
if (isoDates[i][1].exec(string)) {
- // match[5] should be 'T' or undefined
- config._f = isoDates[i][0] + (match[6] || ' ');
+ config._f = isoDates[i][0];
break;
}
}
for (i = 0, l = isoTimes.length; i < l; i++) {
if (isoTimes[i][1].exec(string)) {
- config._f += isoTimes[i][0];
+ // match[6] should be 'T' or space
+ config._f += (match[6] || ' ') + isoTimes[i][0];
break;
}
}
diff --git a/bower_components/moment/src/lib/create/valid.js b/bower_components/moment/src/lib/create/valid.js
index 89204f8..ad56bfe 100644
--- a/bower_components/moment/src/lib/create/valid.js
+++ b/bower_components/moment/src/lib/create/valid.js
@@ -9,6 +9,7 @@ export function isValid(m) {
flags.overflow < 0 &&
!flags.empty &&
!flags.invalidMonth &&
+ !flags.invalidWeekday &&
!flags.nullInput &&
!flags.invalidFormat &&
!flags.userInvalidated;