Skip to content

Commit 828ef3e

Browse files
committed
code changes
1 parent 26cc4f7 commit 828ef3e

File tree

3 files changed

+111
-9
lines changed

3 files changed

+111
-9
lines changed

common/validators/index.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// import moment from "moment";
1+
import moment from "moment";
2+
23
const moment = require("moment");
34

45
const Valiadtors = {
@@ -44,17 +45,11 @@ const Valiadtors = {
4445
},
4546

4647
getWeekOfYear: (params) => {
47-
params.currDate = Date.now();
48-
var year = new Date(parseInt(params.currDate)).getFullYear();
49-
var month = new Date(parseInt(params.currDate)).getMonth() + 1;
50-
var date = new Date(parseInt(params.currDate)).getDate();
51-
return moment(month + "-" + date + "-" + "-" + year, "MM-DD-YYYY").week();
48+
return moment().week();
5249
},
5350

5451
getMonthOfYear: (params) => {
55-
params.currDate = Date.now();
56-
var month = new Date(parseInt(params.currDate)).getMonth() + 1;
57-
return month;
52+
return moment().month() + 1;
5853
},
5954

6055
validatePincode: (pin) => {

package-lock.json

Lines changed: 106 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"request": "^2.88.2",
3131
"strategy": "^1.1.1",
3232
"twilio": "^3.82.1",
33+
"user-auth-microservice": "^3.1.0",
3334
"uuid": "^7.0.3",
3435
"winston": "^3.8.2"
3536
},

0 commit comments

Comments
 (0)