* Make this Duration longer by the specified amount. Return a newly-constructed Duration. * @param {Duration|Object|number} duration - The amount to add. Either a Luxon Duration, a number of milliseconds, the object argument to Duration.fromObject() * @return {Duration}
(duration)
| 652 | * @return {Duration} |
| 653 | */ |
| 654 | plus(duration) { |
| 655 | if (!this.isValid) return this; |
| 656 | |
| 657 | const dur = Duration.fromDurationLike(duration), |
| 658 | result = {}; |
| 659 | |
| 660 | for (const k of orderedUnits) { |
| 661 | if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { |
| 662 | result[k] = dur.get(k) + this.get(k); |
| 663 | } |
| 664 | } |
| 665 | |
| 666 | return clone(this, { values: result }, true); |
| 667 | } |
| 668 | |
| 669 | /** |
| 670 | * Make this Duration shorter by the specified amount. Return a newly-constructed Duration. |
no test coverage detected