Skip to content

V15: Show duration on time displays#18341

Merged
leekelleher merged 16 commits intov15/devfrom
v15/feature/schedule-relative-time
Feb 17, 2025
Merged

V15: Show duration on time displays#18341
leekelleher merged 16 commits intov15/devfrom
v15/feature/schedule-relative-time

Conversation

@iOvergaard
Copy link
Copy Markdown
Contributor

Description

  • Adds helper functions to show a localized duration between two points in time using the Intl.DurationFormat API, which is available in most browsers (Firefox behind a flag).
  • Uses the helper function in the <umb-localize-date /> element to show the duration between now and the time in the title attribute

image

  • Improves the UmbLocalizeDateElement to avoid re-rendering
  • The longer-term idea is to use this in the schedule publishing modal to let the user know more details about their scheduling

@bjarnef
Copy link
Copy Markdown
Contributor

bjarnef commented Feb 15, 2025

@iOvergaard would it be worth looking into this, which does something similar via a duration utils?
umbraco/Umbraco.UI#868

Copy link
Copy Markdown
Member

@leekelleher leekelleher left a comment

Choose a reason for hiding this comment

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

Tested out, works great! 🚀

@leekelleher leekelleher merged commit a485194 into v15/dev Feb 17, 2025
23 of 24 checks passed
@leekelleher leekelleher deleted the v15/feature/schedule-relative-time branch February 17, 2025 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants