Skip to content

Commit

Permalink
Merge pull request #200 from borkarsaish65/bugfix/date_valid
Browse files Browse the repository at this point in the history
Bugfix/date valid
  • Loading branch information
aks30 authored Jan 10, 2025
2 parents 7890c21 + 12e1c3a commit 10206f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
5 changes: 5 additions & 0 deletions envVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,11 @@ let enviromentVariables = {
"value" : "OCI"
}
},
"TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC" : {
"message" : "Required timezone difference between local time and UTC",
"optional" : true,
"default": "+05:30"
}
}

let success = true;
Expand Down
10 changes: 4 additions & 6 deletions module/programs/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ const entityTypesHelper = require(MODULES_BASE_PATH + "/entityTypes/helper");
const entitiesHelper = require(MODULES_BASE_PATH + "/entities/helper");
const userRolesHelper = require(MODULES_BASE_PATH + "/user-roles/helper");
const userService = require(ROOT_PATH + "/generics/services/users");
const timeZoneDifference =
process.env.TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC;
/**
* ProgramsHelper
* @class
Expand Down Expand Up @@ -112,13 +110,13 @@ module.exports = class ProgramsHelper {
if (data.hasOwnProperty("endDate")) {
data.endDate = gen.utils.getEndDate(
data.endDate,
timeZoneDifference
process.env.TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC
);
}
if (data.hasOwnProperty("startDate")) {
data.startDate = gen.utils.getStartDate(
data.startDate,
timeZoneDifference
process.env.TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC
);
}
}
Expand Down Expand Up @@ -366,13 +364,13 @@ module.exports = class ProgramsHelper {
if (data.hasOwnProperty("endDate")) {
data.endDate = gen.utils.getEndDate(
data.endDate,
timeZoneDifference
process.env.TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC
);
}
if (data.hasOwnProperty("startDate")) {
data.startDate = gen.utils.getStartDate(
data.startDate,
timeZoneDifference
process.env.TIMEZONE_DIFFRENECE_BETWEEN_LOCAL_TIME_AND_UTC
);
}
}
Expand Down

0 comments on commit 10206f0

Please sign in to comment.