[BUGFIX] plugin-system: Expose some utils + fix imports#175
Merged
Conversation
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
shahrokni
reviewed
Jun 17, 2026
Comment on lines
+16
to
+30
| export const formatDate = ( | ||
| timeMs: number, | ||
| format: (date: Date, format: string) => string | ||
| ): { date: string; time: string } => { | ||
| // Disallows NaN, Infinity, and -Infinity | ||
| if (!Number.isFinite(timeMs)) { | ||
| return { date: 'N/A', time: 'N/A' }; | ||
| } | ||
|
|
||
| const d = new Date(timeMs); | ||
| return { | ||
| date: format(d, 'MMM dd, yyyy'), | ||
| time: format(d, 'HH:mm:ss'), | ||
| }; | ||
| }; |
Contributor
There was a problem hiding this comment.
This could be placed in components\src\utils\format.ts
WDYT?
Member
Author
There was a problem hiding this comment.
Yeah, I see a method similar to this one. I need to check if I can re-use it
Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
shahrokni
approved these changes
Jun 18, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Export some utils for perses/plugins#642, can wait next release (not blocking).
And found some import issue, strange it worked before 🤔
Small impact on
getDateAndTimeremoved the dash on date, make no sense here, it should be handled afterScreenshots
Checklist
[<catalog_entry>] <commit message>naming convention using one of thefollowing
catalog_entryvalues:FEATURE,ENHANCEMENT,BUGFIX,BREAKINGCHANGE,DOC,IGNORE.UI Changes
See e2e docs for more details. Common issues include: