Skip to content

Commit

Permalink
Merge pull request #120 from gdfreitas/fix/tooltip-date-formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
eatyourpeas authored Oct 25, 2024
2 parents 4ff0f1b + 677530c commit e27fd71
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/CentileChart/CentileChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,9 @@ function CentileChart({
{/* If data points are close together, reduce the size of the point */}

{childMeasurements.map((childMeasurement: Measurement, index) => {
const [observationYear, observationMonth, observationDay] = childMeasurement.measurement_dates.observation_date.split('-');
const observationDate = `${observationDay}/${observationMonth}/${observationYear}`;

const chronData: any = {
age_type: 'chronological_age',
age_error: childMeasurement.measurement_dates.chronological_decimal_age_error,
Expand All @@ -762,9 +765,7 @@ function CentileChart({
childMeasurement.measurement_dates.comments.clinician_chronological_decimal_age_comment,
lay_comment:
childMeasurement.measurement_dates.comments.lay_chronological_decimal_age_comment,
observation_date: new Date(
childMeasurement.measurement_dates.observation_date,
).toLocaleDateString('en-UK'),
observation_date: observationDate,
observation_value_error: childMeasurement.child_observation_value.observation_value_error,
chronological_measurement_error:
childMeasurement.measurement_calculated_values.chronological_measurement_error,
Expand Down Expand Up @@ -794,9 +795,7 @@ function CentileChart({
clinician_comment:
childMeasurement.measurement_dates.comments.clinician_corrected_decimal_age_comment,
lay_comment: childMeasurement.measurement_dates.comments.lay_corrected_decimal_age_comment,
observation_date: new Date(
childMeasurement.measurement_dates.observation_date,
).toLocaleDateString('en-UK'),
observation_date: observationDate,
observation_value_error: childMeasurement.child_observation_value.observation_value_error,
corrected_measurement_error:
childMeasurement.measurement_calculated_values.corrected_measurement_error,
Expand Down

0 comments on commit e27fd71

Please sign in to comment.