From d8dbc74c3a0a4971e5ee5e1350b5ac193fdc5142 Mon Sep 17 00:00:00 2001 From: Mac Deluca Date: Tue, 18 Jun 2024 10:59:19 -0700 Subject: [PATCH] fix: corrected issue with datetimes being incorrectly parsed --- .../profile/captures/capture-form/edit/EditCapturePage.tsx | 2 +- .../captures/components/AnimalCaptureCardContainer.tsx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/features/surveys/animals/profile/captures/capture-form/edit/EditCapturePage.tsx b/app/src/features/surveys/animals/profile/captures/capture-form/edit/EditCapturePage.tsx index 042b2d4574..6f400c0e62 100644 --- a/app/src/features/surveys/animals/profile/captures/capture-form/edit/EditCapturePage.tsx +++ b/app/src/features/surveys/animals/profile/captures/capture-form/edit/EditCapturePage.tsx @@ -135,7 +135,7 @@ export const EditCapturePage = () => { capture_date: values.capture.capture_date, capture_time: values.capture.capture_time || undefined, release_date: values.capture.release_date || values.capture.capture_date || undefined, - release_time: values.capture.release_time || values.capture.release_date || undefined, + release_time: values.capture.release_time || values.capture.capture_time || undefined, capture_comment: values.capture.capture_comment || undefined, release_comment: values.capture.release_comment || undefined, capture_location: captureLocation, diff --git a/app/src/features/surveys/animals/profile/captures/components/AnimalCaptureCardContainer.tsx b/app/src/features/surveys/animals/profile/captures/components/AnimalCaptureCardContainer.tsx index d8e144eced..ac5b81c303 100644 --- a/app/src/features/surveys/animals/profile/captures/components/AnimalCaptureCardContainer.tsx +++ b/app/src/features/surveys/animals/profile/captures/components/AnimalCaptureCardContainer.tsx @@ -19,6 +19,7 @@ import { ISurveyCritter } from 'contexts/animalPageContext'; import { useSurveyContext } from 'hooks/useContext'; import { useState } from 'react'; import { Link as RouterLink } from 'react-router-dom'; +import { combineDateTime } from 'utils/datetime'; import { getFormattedDate } from 'utils/Utils'; import { ICaptureWithSupplementaryData } from '../AnimalCaptureContainer'; import { AnimalCaptureCardDetailsContainer } from './capture-card-details/AnimalCaptureCardDetailsContainer'; @@ -159,7 +160,10 @@ export const AnimalCaptureCardContainer = (props: IAnimalCaptureCardContainer) = }}> - {getFormattedDate(DATE_FORMAT.MediumDateTimeFormat, capture.capture_date)} + {getFormattedDate( + DATE_FORMAT.MediumDateTimeFormat, + combineDateTime(capture.capture_date, capture.capture_time) + )}   {capture.capture_location.latitude && capture.capture_location.longitude && (