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

fix(analysis): Now displays the correct elec analysis for the first month of a year

parent c5e7e2b6
Branches
Tags
2 merge requests!530chore(release): 1.6.4,!516fix(analysis): Now displays the correct elec analysis for the first month of a year
...@@ -63,9 +63,10 @@ const ElecHalfHourMonthlyAnalysis: React.FC<ElecHalfHourMonthlyAnalysisProps> = ...@@ -63,9 +63,10 @@ const ElecHalfHourMonthlyAnalysis: React.FC<ElecHalfHourMonthlyAnalysisProps> =
if (subscribed) { if (subscribed) {
if (activateHalfHourLoad) { if (activateHalfHourLoad) {
const emas = new EnedisMonthlyAnalysisDataService(client) const emas = new EnedisMonthlyAnalysisDataService(client)
const aggegatedDate = analysisDate.minus({ month: 1 })
const data = await emas.getEnedisMonthlyAnalysisByDate( const data = await emas.getEnedisMonthlyAnalysisByDate(
analysisDate.year, aggegatedDate.year,
analysisDate.month - 1 aggegatedDate.month
) )
if (subscribed && data && data.length) { if (subscribed && data && data.length) {
const aggregatedData = emas.aggregateValuesToDataLoad(data[0]) const aggregatedData = emas.aggregateValuesToDataLoad(data[0])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment