Fix incidents for bookings with break between #74

Merged
bilal.catic merged 2 commits from fix-incidents-for-bookings-with-break-between into master 2019-12-06 05:46:44 +01:00
Showing only changes of commit d4f205af1f - Show all commits

View File

@@ -177,8 +177,8 @@ const setUnlockedIncidentsLevel = (incidents) => {
formattedIncident.incidentLevel = unlockedIncidentLevelsPrices.UNLOCKED_0.title;
formattedIncident.incidentLevelPrice = unlockedIncidentLevelsPrices.UNLOCKED_0.price;
} else {
const lastIncidentTime = moment.utc(memberLastIncident.incidentTimestamp).startOf('month');
const currentIncidentTime = moment.utc(incident.unlockTimestamp).startOf('month');
const lastIncidentTime = moment.tz(memberLastIncident.incidentTimestamp, UI_TIMEZONE).startOf('month');
const currentIncidentTime = moment.tz(incident.unlockTimestamp, UI_TIMEZONE).startOf('month');
const timeDiff = Math.abs(lastIncidentTime.diff(currentIncidentTime, 'months'));
if (timeDiff >= (parseInt(process.env.UNLOCK_STREAK_REPAIR_AFTER) || 6)){