Skip to content

Commit

Permalink
Merge pull request #794 from BIDMCDigitalPsychiatry/issue-777
Browse files Browse the repository at this point in the history
QA fixes
  • Loading branch information
sarithapillai8 authored Nov 9, 2023
2 parents 1a3eaf4 + 3f1ae74 commit 3516ba6
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions src/components/PreventSelectedActivities.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ const getStartTime = (tag: { limit: number; unit: string; timeframe: number; sta
case "weeks":
diff = (new Date().getTime() - diffDate.getTime()) / (7 * tag.timeframe * 24 * 60 * 60 * 1000)
diffDate = new Date(tag.startDate + 7 * Math.floor(diff) * tag.timeframe * 24 * 60 * 60 * 1000)
diffDate.setDate(diffDate.getDate())
break
case "months":
diff = (new Date().getTime() - diffDate.getTime()) / (30 * tag.timeframe * 24 * 60 * 60 * 1000)
Expand All @@ -299,18 +298,12 @@ const getStartTime = (tag: { limit: number; unit: string; timeframe: number; sta
case "days":
diff = (new Date().getTime() - diffDate.getTime()) / (24 * tag.timeframe * 60 * 60 * 1000)
diffDate = new Date(tag.startDate + Math.floor(diff) * tag.timeframe * 24 * 60 * 60 * 1000)
diffDate.setDate(diffDate.getDate())
break
case "hours":
diff = (new Date().getTime() - diffDate.getTime()) / (tag.timeframe * 60 * 60 * 1000)
diffDate = new Date(tag.startDate + Math.floor(diff) * tag.timeframe * 60 * 60 * 1000)
break
}
if (tag.unit !== "hours") {
diffDate.setHours(new Date(tag.startDate).getHours())
diffDate.setMinutes(new Date(tag.startDate).getMinutes())
diffDate.setSeconds(new Date(tag.startDate).getSeconds())
}
startTime = diffDate.getTime()
return startTime
}
Expand Down

0 comments on commit 3516ba6

Please sign in to comment.