Skip to content

Fix relative date unit calculation in admin.js#24

Open
g000m wants to merge 1 commit into
FacetWP:masterfrom
g000m:fix/relative-date-units
Open

Fix relative date unit calculation in admin.js#24
g000m wants to merge 1 commit into
FacetWP:masterfrom
g000m:fix/relative-date-units

Conversation

@g000m
Copy link
Copy Markdown

@g000m g000m commented May 16, 2026

fixes issues #21

Copilot AI review requested due to automatic review settings May 16, 2026 21:37
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes the “time ago” display in the admin UI by correcting how the appropriate relative-time unit (seconds/minutes/hours/…) is selected from the tokens map, addressing issue #21 where values were always shown in seconds.

Changes:

  • Update LHR.formatTimeSince to select the largest matching time unit (instead of returning on the first match).
  • Compute numberOfUnits based on the selected unit and format the final "X unit(s)" string.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@g000m g000m force-pushed the fix/relative-date-units branch from 9d2f7b0 to 0b219b8 Compare May 16, 2026 21:40
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