Skip to content

feat(acr): aligning formatDate utility with ADR012 using Luxon #4238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

its-mitesh-kumar
Copy link
Contributor

Description

This pull request refactors the formatDate utility to use luxon instead of date-fns. This work is part of the larger effort to remove dependencies on the @janus-idp/shared-react package.

This change aligns the utility with ADR012: Adopt Luxon as a standardized date and time library, which aims to standardize date/time handling across the codebase for better consistency and maintainability.

The new implementation maintains the existing function signature and behavior:

  • It correctly handles string, number (Unix timestamp), and Date object inputs.
  • It continues to return 'N/A' for null, undefined, or invalid date inputs.
  • The output format string has been updated to the luxon equivalent to ensure consistent presentation.

Fixes

Fixing https://issues.redhat.com/browse/RHIDP-7403

UI before changes

ACR-1

UI after changes

Screenshot 2025-06-09 at 6 28 58 PM (2)

@backstage-goalie
Copy link
Contributor

backstage-goalie bot commented Jun 9, 2025

Changed Packages

Package Name Package Path Changeset Bump Current Version
@backstage-community/plugin-acr workspaces/acr/plugins/acr patch v1.14.1

Signed-off-by: its-mitesh-kumar <[email protected]>
Copy link
Contributor

@debsmita1 debsmita1 left a comment

Choose a reason for hiding this comment

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

  • please remove the shared-react dependency from the package.json if it is not used anymore in the acr plugin and re-run yarn install to update the yarn.lock
  • add tests for the new util

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