Skip to content

Commit be71782

Browse files
committed
fix: add formatting for last snapshot time in tippy
1 parent e9aa269 commit be71782

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/app/details/appDetails/SourceInfo.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { useParams } from 'react-router-dom'
2020
import Tippy from '@tippyjs/react'
2121
import {
2222
ConditionalWrap,
23+
DATE_TIME_FORMATS,
2324
DeploymentAppTypes,
2425
getIsManualApprovalConfigured,
2526
handleUTCTime,
@@ -170,7 +171,7 @@ export const SourceInfo = ({
170171
const renderDevtronAppsEnvironmentSelector = (environment) => {
171172
// If moving to a component then move getIsApprovalConfigured with it as well with memoization.
172173
const isApprovalConfigured = getIsApprovalConfigured()
173-
const lastSnapshotTime = appDetails?.resourceTree?.lastSnapshotTime ? handleUTCTime(
174+
const relativeSnapshotTime = appDetails?.resourceTree?.lastSnapshotTime ? handleUTCTime(
174175
appDetails.resourceTree.lastSnapshotTime,
175176
true,
176177
) : ''
@@ -202,12 +203,14 @@ export const SourceInfo = ({
202203
</div>
203204
)}
204205
{/* Last snapshot time */}
205-
{isAirGappedIsolatedEnv && lastSnapshotTime && (
206+
{isAirGappedIsolatedEnv && relativeSnapshotTime && (
206207
<Tooltip
207208
content={
208209
<div className="fw-4 lh-18 flexbox-col dc__ga-2">
209210
<h6 className="fs-12 fw-6 cn-0 m-0">Last snapshot received</h6>
210-
<p className="m-0 fs-12 cn-50">{lastSnapshotTime}</p>
211+
<p className="m-0 fs-12 cn-50">
212+
{moment(relativeSnapshotTime).format(DATE_TIME_FORMATS.TWELVE_HOURS_FORMAT)}
213+
</p>
211214
</div>
212215
}
213216
alwaysShowTippyOnHover

0 commit comments

Comments
 (0)