Skip to content

Commit 10206f0

Browse files
authored
Merge pull request #200 from borkarsaish65/bugfix/date_valid
Bugfix/date valid
2 parents 7890c21 + 12e1c3a commit 10206f0

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

envVariables.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ let enviromentVariables = {
190190
"value" : "OCI"
191191
}
192192
},
193+
"TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC" : {
194+
"message" : "Required timezone difference between local time and UTC",
195+
"optional" : true,
196+
"default": "+05:30"
197+
}
193198
}
194199

195200
let success = true;

module/programs/helper.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ const entityTypesHelper = require(MODULES_BASE_PATH + "/entityTypes/helper");
1111
const entitiesHelper = require(MODULES_BASE_PATH + "/entities/helper");
1212
const userRolesHelper = require(MODULES_BASE_PATH + "/user-roles/helper");
1313
const userService = require(ROOT_PATH + "/generics/services/users");
14-
const timeZoneDifference =
15-
process.env.TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC;
1614
/**
1715
* ProgramsHelper
1816
* @class
@@ -112,13 +110,13 @@ module.exports = class ProgramsHelper {
112110
if (data.hasOwnProperty("endDate")) {
113111
data.endDate = gen.utils.getEndDate(
114112
data.endDate,
115-
timeZoneDifference
113+
process.env.TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC
116114
);
117115
}
118116
if (data.hasOwnProperty("startDate")) {
119117
data.startDate = gen.utils.getStartDate(
120118
data.startDate,
121-
timeZoneDifference
119+
process.env.TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC
122120
);
123121
}
124122
}
@@ -366,13 +364,13 @@ module.exports = class ProgramsHelper {
366364
if (data.hasOwnProperty("endDate")) {
367365
data.endDate = gen.utils.getEndDate(
368366
data.endDate,
369-
timeZoneDifference
367+
process.env.TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC
370368
);
371369
}
372370
if (data.hasOwnProperty("startDate")) {
373371
data.startDate = gen.utils.getStartDate(
374372
data.startDate,
375-
timeZoneDifference
373+
process.env.TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC
376374
);
377375
}
378376
}

0 commit comments

Comments
 (0)