Skip to content

V15: Show duration on time displays #18341

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

Merged
merged 16 commits into from
Feb 17, 2025

Conversation

iOvergaard
Copy link
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
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
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