question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature request: toRelative multiple units

See original GitHub issue

It would be great to specify multiple units for toRelative() to receive a more precise result if the date is less than 24 hours.

toRelative({ units: ['days', 'hours' ]})

> 24 hours

in 2 days

< 24 hours

in 10 hours

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
GillesDebunnecommented, Oct 26, 2019

The difference between these two methods is that toRelative deals with datetime whereas toRelativeCalendar handles dates only. Hence the day granularity for the latter.

0reactions
andreialecucommented, Apr 30, 2021

I opened a PR at #926 to implement this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature request: toRelative multiple units #672 - GitHub
Its format method which is used by toRelative only accepts a value and a single unit, to create texts such as one day...
Read more >
Feature request: dual sharing - Microsoft Community Hub
Having two people share would be useful. In real life you can have two things in the room to switch between. You need...
Read more >
Server-side rendering (SSR) with Angular Universal
These services send requests to relative URLs such as api/heroes . In a server-side rendered app, HTTP URLs must be absolute (for example,...
Read more >
Flyspray::QCAD Bugtracker: Tasklist
Flyspray, a Bug Tracking System written in PHP.
Read more >
Feature request response email templates - LiveAgent
Feature requests are messages that customers send to inquire about a feature that is not included in your product or service. Receiving feature...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found