Get Unit of Time2.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');
Invalid durations return NaN
for all units.
当前内容版权归 momentjs.com 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 momentjs.com .