Skip to content

Latest commit

 

History

History
18 lines (14 loc) · 424 Bytes

File metadata and controls

18 lines (14 loc) · 424 Bytes
title Get Unit of Time
version 2.1.0
signature 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');

Invalid durations return NaN for all units.