Skip to content

Commit 318df17

Browse files
fix format
1 parent 5f263eb commit 318df17

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

web/locales/en/plugin__netobserv-plugin.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@
247247
"State": "State",
248248
"Severity": "Severity",
249249
"Active since": "Active since",
250-
"Yesterday": "Yesterday",
251250
"Labels": "Labels",
252251
"Description": "Description",
253252
"Navigate to network traffic": "Navigate to network traffic",

web/src/components/health/alert-details.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ export const AlertDetails: React.FC<AlertDetailsProps> = ({ resourceName, alert
2727
<AlertDetailsValue title={t('State')}>{alert.state}</AlertDetailsValue>
2828
<AlertDetailsValue title={t('Severity')}>{alert.labels.severity}</AlertDetailsValue>
2929
{alert.activeAt && (
30-
<AlertDetailsValue title={t('Active since')}>
31-
{formatActiveSince(alert.activeAt)}
32-
</AlertDetailsValue>
30+
<AlertDetailsValue title={t('Active since')}>{formatActiveSince(alert.activeAt)}</AlertDetailsValue>
3331
)}
3432
<AlertDetailsValue title={t('Labels')}>
3533
{labels.length === 0

web/src/utils/datetime.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,11 @@ export const formatActiveSince = (timestamp: string): string => {
150150
// Yesterday: show "Yesterday, HH:MM"
151151
const yesterday = new Date(now);
152152
yesterday.setDate(yesterday.getDate() - 1);
153-
if (activeDate.getDate() === yesterday.getDate() &&
154-
activeDate.getMonth() === yesterday.getMonth() &&
155-
activeDate.getFullYear() === yesterday.getFullYear()) {
153+
if (
154+
activeDate.getDate() === yesterday.getDate() &&
155+
activeDate.getMonth() === yesterday.getMonth() &&
156+
activeDate.getFullYear() === yesterday.getFullYear()
157+
) {
156158
return `Yesterday, ${timeStr}`;
157159
}
158160

0 commit comments

Comments
 (0)