Skip to content
Snippets Groups Projects
Commit 2d37502c authored by Yoan VALLET's avatar Yoan VALLET
Browse files

Merge branch 'fix/fix-action-duration' into 'dev'

Fix enddate of action

See merge request web-et-numerique/llle_project/ecolyo!302
parents 69df0c4d 5d67a7a0
No related branches found
No related tags found
1 merge request!302Fix enddate of action
......@@ -259,10 +259,9 @@ export default class ActionService {
currentChallenge.action.ecogesture
) {
const startDate: DateTime = currentChallenge.action.startDate
const durationInHours =
currentChallenge.action.ecogesture.actionDuration * 24
const progressInHours = -startDate.diffNow('hours').hours
if (progressInHours > durationInHours) {
const duration = currentChallenge.action.ecogesture.actionDuration
const progress = -startDate.startOf('day').diffNow('days').days
if (progress >= duration) {
const challengeService = new ChallengeService(this._client)
const userChallenge: UserChallenge = await challengeService.updateUserChallenge(
currentChallenge,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment