Skip to content

Commit

Permalink
fix: corrected issue with datetimes being incorrectly parsed
Browse files Browse the repository at this point in the history
  • Loading branch information
MacQSL committed Jun 18, 2024
1 parent 5e55d78 commit d8dbc74
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -159,7 +160,10 @@ export const AnimalCaptureCardContainer = (props: IAnimalCaptureCardContainer) =
}}>
<Stack gap={0.5} display="flex">
<Typography fontWeight={700}>
{getFormattedDate(DATE_FORMAT.MediumDateTimeFormat, capture.capture_date)}
{getFormattedDate(
DATE_FORMAT.MediumDateTimeFormat,
combineDateTime(capture.capture_date, capture.capture_time)
)}
&nbsp;
</Typography>
{capture.capture_location.latitude && capture.capture_location.longitude && (
Expand Down

0 comments on commit d8dbc74

Please sign in to comment.