Skip to content

Commit

Permalink
fix: remove as
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikmv committed Mar 21, 2024
1 parent a16cc88 commit 4996713
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/utils/Hooks/Calculations/useCalculateMinMaxValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ export function useCalculateMinMaxValues(datasetValues: Array<any>) {
if (!datasetValues) {
return { min: 0, max: 0 };
}
const flatValues: number[] = datasetValues.flatMap((entry: any) => Object.values(entry)) as number[];
const flatValues: number[] = datasetValues.flatMap((entry: any) => Number(Object.values(entry)));
return {
min: Math.min(...flatValues),
max: Math.max(...flatValues),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ export const useMeasurementPlotting = (
let yValue: number;

if (category === 'wflh_b' || category === 'wflh_g') {
xValue = parseFloat(entry.dataValues.height as string);
yValue = parseFloat(entry.dataValues.weight as string);
if (category === 'wflh_b' || category === 'wflh_g') {
xValue = parseFloat(String(entry.dataValues.height));
yValue = parseFloat(String(entry.dataValues.weight));
}
} else {
const dateString: string = typeof entry.eventDate === 'string' ? entry.eventDate : entry.eventDate.toISOString();
const xValueDecimalDate: string = useCalculateDecimalDate(dateString, dataset, dateOfBirth);
xValue = xValueDecimalDate;
yValue = parseFloat(entry.dataValues[fieldName] as string);
yValue = parseFloat(String(entry.dataValues[fieldName]));
}

const eventDateValue = new Date(entry.eventDate);
Expand Down

0 comments on commit 4996713

Please sign in to comment.