Permalink
080ad4f Jan 21, 2016
21 lines (16 sloc) 480 Bytes
title version signature
Subtract Time
2.1.0
moment.duration().subtract(Number, String); moment.duration().subtract(Number); moment.duration().subtract(Duration); moment.duration().subtract(Object);

Mutates the original duration by subtracting time.

The same keys and shorthands used to create durations can be used here as the second argument.

var a = moment.duration(3, 'd');
var b = moment.duration(2, 'd');
a.subtract(b).days(); // 1