Skip to content
Snippets Groups Projects
Commit b6c82a34 authored by Guilhem CARRON's avatar Guilhem CARRON
Browse files

fix(analysis): fix previous month display

parent c9ccf89b
No related branches found
No related tags found
2 merge requests!530chore(release): 1.6.4,!512chore(release): 1.6.0
......@@ -111,7 +111,7 @@ const MonthlyAnalysis: React.FC<MonthlyAnalysisProps> = ({
return () => {
subscribed = false
}
}, [client, timeStep, fluidTypes, analysisDate])
}, [client, timeStep, fluidTypes, analysisDate, setView])
return (
<>
......
......@@ -7,8 +7,6 @@ import { FluidType } from 'enum/fluid.enum'
import { PerformanceIndicator } from 'models'
import { getPicto } from 'utils/picto'
import { formatNumberValues, getPreviousMonthName } from 'utils/utils'
import StyledCard from 'components/CommonKit/Card/StyledCard'
import StyledIcon from 'components/CommonKit/Icon/StyledIcon'
interface FluidPerformanceIndicatorProps {
......
......@@ -285,7 +285,7 @@ const monthlyReportNotification = async ({
),
pollText: monthlyReport.question.replace(/{cozyUrl}/g, appLink + '#/'),
pollUrl: monthlyReport.link,
previousMonth: getPreviousMonthName(date),
previousMonth: getPreviousMonthName(date.minus({ month: 1 })),
consoImageUrl: baseUrl + '/assets/multifluidConsumption.png',
})
......
......@@ -145,7 +145,7 @@ export const getPreviousMonthName = (date: DateTime) => {
'novembre',
'décembre',
]
return monthNames[date.month - 2]
return monthNames[date.month - 1]
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment