Permalink
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (14 sloc) 390 Bytes
title version signature
Is a Duration
1.6.0
moment.isDuration(obj);

To check if a variable is a moment duration object, use moment.isDuration().

moment.isDuration() // false
moment.isDuration(new Date()) // false
moment.isDuration(moment()) // false
moment.isDuration(moment.duration()) // true
moment.isDuration(moment.duration(2, 'minutes')) // true