summaryrefslogtreecommitdiff
path: root/node_modules/moment/src/lib/create/from-object.js
diff options
context:
space:
mode:
authorAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-08-18 13:29:54 +0300
committerAlexander Neonxp Kiryukhin <i@neonxp.ru>2024-08-18 13:29:54 +0300
commitfd70f95224374d23157ee7c0357733102cd0df53 (patch)
treee490c12e021cedaf211b292d5d623baa32a673fc /node_modules/moment/src/lib/create/from-object.js
initialHEADmaster
Diffstat (limited to 'node_modules/moment/src/lib/create/from-object.js')
-rw-r--r--node_modules/moment/src/lib/create/from-object.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/node_modules/moment/src/lib/create/from-object.js b/node_modules/moment/src/lib/create/from-object.js
new file mode 100644
index 0000000..55d15c7
--- /dev/null
+++ b/node_modules/moment/src/lib/create/from-object.js
@@ -0,0 +1,20 @@
+import { normalizeObjectUnits } from '../units/aliases';
+import { configFromArray } from './from-array';
+import map from '../utils/map';
+
+export function configFromObject(config) {
+ if (config._d) {
+ return;
+ }
+
+ var i = normalizeObjectUnits(config._i),
+ dayOrDate = i.day === undefined ? i.date : i.day;
+ config._a = map(
+ [i.year, i.month, dayOrDate, i.hour, i.minute, i.second, i.millisecond],
+ function (obj) {
+ return obj && parseInt(obj, 10);
+ }
+ );
+
+ configFromArray(config);
+}