diff --git a/src/caretogether-pwa/src/Activities/ActivityTimeline.tsx b/src/caretogether-pwa/src/Activities/ActivityTimeline.tsx index 1ba3f28e..25f76192 100644 --- a/src/caretogether-pwa/src/Activities/ActivityTimeline.tsx +++ b/src/caretogether-pwa/src/Activities/ActivityTimeline.tsx @@ -94,6 +94,20 @@ const composeNoteType = (activity: Activity): string | null => { return null; }; +const shouldShowTimelineTime = (item: MergedTimelineItem) => { + if (item.kind !== 'family-activity') return false; + + return item.activity instanceof ChildLocationChanged; +}; + +const formatTimelineTimestamp = (item: MergedTimelineItem) => { + if (shouldShowTimelineTime(item)) { + return format(item.timestamp, 'M/d/yy h:mm a'); + } + + return format(item.timestamp, 'M/d/yy'); +}; + function embedNotesInActivities(notes: Note[], activities: Activity[]) { // We only want to show each note once, on the most recent activity entry that is // linked to that particular note. The following stateful code works by pulling from the @@ -576,7 +590,7 @@ export function ActivityTimeline({ > - {format(item.timestamp, 'M/d/yy h:mm a')} + {formatTimelineTimestamp(item)} {item.userId ? ( diff --git a/src/caretogether-pwa/src/V1Referrals/V1ReferralTimeline.tsx b/src/caretogether-pwa/src/V1Referrals/V1ReferralTimeline.tsx index 7fee5870..3658c733 100644 --- a/src/caretogether-pwa/src/V1Referrals/V1ReferralTimeline.tsx +++ b/src/caretogether-pwa/src/V1Referrals/V1ReferralTimeline.tsx @@ -77,7 +77,7 @@ export function ReferralTimeline({ > - {format(item.timestamp, 'M/d/yy h:mm a')} + {format(item.timestamp, 'M/d/yy')} {item.userId ? (