Skip to content

Commit

Permalink
Merge pull request #11 from ELEVATE-Project/cronJobs
Browse files Browse the repository at this point in the history
Cron jobs
  • Loading branch information
rakeshSgr authored Dec 6, 2021
2 parents d7e43a1 + fea7002 commit ce88843
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions services/helper/sessions.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,18 @@ module.exports = class SessionsHelper {
}

if(bodyData.startDate){
bodyData.startDate = moment.unix(bodyData.startDate).format()
bodyData.startDate = moment.unix(bodyData.startDate);
if(bodyData.timeZone){
bodyData.startDate.tz(bodyData.timeZone);
}
bodyData.startDate = moment(bodyData.startDate).format();
}
if(bodyData.endDate){
bodyData.endDate = moment.unix(bodyData.endDate).format()
bodyData.endDate = moment.unix(bodyData.endDate);
if(bodyData.timeZone){
bodyData.endDate.tz(bodyData.timeZone);
}
bodyData.endDate = moment(bodyData.endDate).format();
}

let data = await sessionData.createSession(bodyData);
Expand Down Expand Up @@ -71,10 +79,18 @@ module.exports = class SessionsHelper {


if(bodyData.startDate){
bodyData.startDate = moment.unix(bodyData.startDate).format()
bodyData.startDate = moment.unix(bodyData.startDate);
if(bodyData.timeZone){
bodyData.startDate.tz(bodyData.timeZone);
}
bodyData.startDate = moment(bodyData.startDate).format();
}
if(bodyData.endDate){
bodyData.endDate = moment.unix(bodyData.endDate).format()
bodyData.endDate = moment.unix(bodyData.endDate);
if(bodyData.timeZone){
bodyData.endDate.tz(bodyData.timeZone);
}
bodyData.endDate = moment(bodyData.endDate).format();
}


Expand Down

0 comments on commit ce88843

Please sign in to comment.