Skip to content

[BUGFIX] plugin-system: Expose some utils + fix imports#175

Merged
Gladorme merged 2 commits into
perses:mainfrom
Gladorme:fix/imports
Jun 18, 2026
Merged

[BUGFIX] plugin-system: Expose some utils + fix imports#175
Gladorme merged 2 commits into
perses:mainfrom
Gladorme:fix/imports

Conversation

@Gladorme

@Gladorme Gladorme commented Jun 17, 2026

Copy link
Copy Markdown
Member

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 getDateAndTime removed the dash on date, make no sense here, it should be handled after

Screenshots

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

UI Changes

  • Changes that impact the UI include screenshots and/or screencasts of the relevant changes.
  • Code follows the UI guidelines.
  • E2E tests are stable and unlikely to be flaky.
    See e2e docs for more details. Common issues include:
    • Is the data inconsistent? You need to mock API requests.
    • Does the time change? You need to use consistent time values or mock time utilities.
    • Does it have loading states? You need to wait for loading to complete.

Signed-off-by: Guillaume LADORME <Gladorme@users.noreply.github.com>
@Gladorme Gladorme requested a review from a team as a code owner June 17, 2026 08:31
@shahrokni shahrokni self-requested a review June 17, 2026 08:40
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'),
};
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be placed in components\src\utils\format.ts
WDYT?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@Gladorme Gladorme changed the title [IGNORE] plugin-system: Expose some utils + fix imports [BUGFIX] plugin-system: Expose some utils + fix imports Jun 18, 2026
@Gladorme Gladorme merged commit b5e8497 into perses:main Jun 18, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants