Permalink
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (13 sloc) 377 Bytes
title version signature
Get Unit of Time
2.1.0
moment.duration().get(String);

As an alternate to Duration#x() getters, you can use Duration#get('x'). All the shorthand keys from moment#add apply here as well.

duration.get('hours');
duration.get('minutes');
duration.get('seconds');
duration.get('milliseconds');