Skip to content

feat(ui): add addSuffix option to formatTimeToNow#15673

Open
michaelcamper wants to merge 1 commit intopayloadcms:mainfrom
michaelcamper:feat/ui-add-suffix-format-time
Open

feat(ui): add addSuffix option to formatTimeToNow#15673
michaelcamper wants to merge 1 commit intopayloadcms:mainfrom
michaelcamper:feat/ui-add-suffix-format-time

Conversation

@michaelcamper
Copy link

Summary

  • Adds optional addSuffix parameter to the formatTimeToNow utility function
  • Passes it through to date-fns formatDistanceToNow, enabling output like "3 minutes ago" instead of just "3 minutes"
  • This allows plugin developers to reuse this utility with the suffix behavior when displaying relative timestamps

Test plan

  • Verify existing callers of formatTimeToNow are unaffected (parameter is optional with no default change)
  • Verify passing addSuffix: true appends the suffix correctly (e.g. "3 minutes ago")

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.

1 participant

Comments