-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Backport 2.3] Fix default last scan date formatter (#4977)
* Change default last scan date formatter * Add changelog Co-authored-by: Álex <alejandro.ruiz.becerra@wazuh.com>
- Loading branch information
1 parent
7d66538
commit 14224c2
Showing
5 changed files
with
26 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export * from './api-requests'; | ||
export * from './api-requests'; | ||
export * from './utils'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { formatUIDate } from '../../../../../react-services/time-service'; | ||
|
||
// This method was created because Wazuh API returns 1970-01-01T00:00:00Z dates or undefined ones | ||
// when vulnerability module is not configured | ||
// its meant to render nothing when such date is received | ||
export function beautifyDate(date?: string) { | ||
return date && | ||
(!['-'].includes(date) && !date.startsWith('1970')) ? | ||
formatUIDate(date) : '-'; | ||
} |