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.

plus/minus functions don't seem to support fractional inputs

See original GitHub issue

DateTime.local().plus({days: 0.8})

Fractional values for a unit, like above, don’t seem to work. My use case is that I’m getting a value that is always normalized to days from an API and want to add it to the current time.

I thought maybe I could get around this by using Duration.fromObject({days: 0.8}).normalize(), but normalize also doesn’t convert it to the whole number hour/minute units either.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
icambroncommented, Sep 22, 2019

Fixed in ee70b8b and released in 1.18.2

0reactions
leebickmtucommented, Sep 22, 2019

Just tested, looks good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hackerrank | Solution of Plus Minus in Golang - Rishabh Jain
The problem statement states that we are given an array of elements, and we need to print the fraction of positive, negative and...
Read more >
Hackerrank: Plus Minus - javascript - Stack Overflow
This is a simple and fast solution: you can use the filter function to iterate in the array and get a new array...
Read more >
Write fraction out of equation - TeX - LaTeX Stack Exchange
I want to write as a math fraction 1 ...
Read more >
Are fractional objective functions possible? - D-Wave Systems
The fractional objective function consists of separate functions for the numerator and the denominator. The goal is to minimize the ratio ...
Read more >
Math Expressions | Unreal Engine 4.27 Documentation
The ArcsineFast expression outputs an approximation of the inverse sine function that is faster to calculate than the more accurate Arcsine expression. Input...
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