@stbmoz-onboarding/core 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dates/dates.js +12 -3
- package/package.json +11 -11
package/Dates/dates.js
CHANGED
|
@@ -24,7 +24,7 @@ const dateGenerator = (date) => {
|
|
|
24
24
|
date = date.slice(0, 10)
|
|
25
25
|
const _date = date.split('-')
|
|
26
26
|
const newDate = new Date()
|
|
27
|
-
const month = parseInt(_date[1]) -1;
|
|
27
|
+
const month = parseInt(_date[1]) - 1;
|
|
28
28
|
|
|
29
29
|
newDate.setFullYear(_date[0])
|
|
30
30
|
newDate.setMonth(month)
|
|
@@ -35,15 +35,24 @@ const dateGenerator = (date) => {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
module.exports.ValidateDate = (values, key, errors, invalidDateMsg) => {
|
|
38
|
+
let date = new Date(values[key])
|
|
39
|
+
|
|
38
40
|
try {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
if (key !== 'dateOfBirth') {
|
|
42
|
+
date = dateGenerator(date.toISOString())
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
date = dateGenerator(values[key])
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
if (date == "Invalid Date") {
|
|
42
49
|
errors[key] = invalidDateMsg
|
|
43
50
|
} else {
|
|
44
51
|
values[key] = date
|
|
45
52
|
}
|
|
53
|
+
|
|
46
54
|
} catch (error) {
|
|
55
|
+
console.log(error)
|
|
47
56
|
errors[key] = invalidDateMsg
|
|
48
57
|
}
|
|
49
58
|
}
|
package/package.json
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_args": [
|
|
3
3
|
[
|
|
4
|
-
"@stbmoz-onboarding/core@1.1.
|
|
4
|
+
"@stbmoz-onboarding/core@1.1.8",
|
|
5
5
|
"/Users/pedrodava/Desktop/Bank/RAO/frontend"
|
|
6
6
|
]
|
|
7
7
|
],
|
|
8
|
-
"_from": "@stbmoz-onboarding/core@^1.1.
|
|
9
|
-
"_id": "@stbmoz-onboarding/core@1.1.
|
|
8
|
+
"_from": "@stbmoz-onboarding/core@^1.1.8",
|
|
9
|
+
"_id": "@stbmoz-onboarding/core@1.1.8",
|
|
10
10
|
"_inBundle": false,
|
|
11
|
-
"_integrity": "sha512-
|
|
11
|
+
"_integrity": "sha512-uhG5NYmnUG4akiMaDXF5MQIkITdFOqBykw9c3QuNWWjuS8spknL1cCGG2YuJWiB7Tryv2GT2hn0ikSeJF+oaeg==",
|
|
12
12
|
"_location": "/@stbmoz-onboarding/core",
|
|
13
13
|
"_phantomChildren": {},
|
|
14
14
|
"_requested": {
|
|
15
15
|
"type": "range",
|
|
16
16
|
"registry": true,
|
|
17
|
-
"raw": "@stbmoz-onboarding/core@^1.1.
|
|
17
|
+
"raw": "@stbmoz-onboarding/core@^1.1.8",
|
|
18
18
|
"name": "@stbmoz-onboarding/core",
|
|
19
19
|
"escapedName": "@stbmoz-onboarding%2fcore",
|
|
20
20
|
"scope": "@stbmoz-onboarding",
|
|
21
|
-
"rawSpec": "^1.1.
|
|
21
|
+
"rawSpec": "^1.1.8",
|
|
22
22
|
"saveSpec": null,
|
|
23
|
-
"fetchSpec": "^1.1.
|
|
23
|
+
"fetchSpec": "^1.1.8"
|
|
24
24
|
},
|
|
25
25
|
"_requiredBy": [
|
|
26
26
|
"#USER",
|
|
27
27
|
"/"
|
|
28
28
|
],
|
|
29
|
-
"_resolved": "https://registry.npmjs.org/@stbmoz-onboarding/core/-/core-1.1.
|
|
30
|
-
"_shasum": "
|
|
31
|
-
"_spec": "@stbmoz-onboarding/core@^1.1.
|
|
29
|
+
"_resolved": "https://registry.npmjs.org/@stbmoz-onboarding/core/-/core-1.1.8.tgz",
|
|
30
|
+
"_shasum": "281798262943ff040b20d08ca2e86135b956fc02",
|
|
31
|
+
"_spec": "@stbmoz-onboarding/core@^1.1.8",
|
|
32
32
|
"_where": "/Users/pedrodava/Desktop/Bank/RAO/frontend",
|
|
33
33
|
"author": "",
|
|
34
34
|
"bundleDependencies": false,
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
43
43
|
},
|
|
44
44
|
"type": "commonjs",
|
|
45
|
-
"version": "1.1.
|
|
45
|
+
"version": "1.1.8"
|
|
46
46
|
}
|