Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
title version signature
Weeks
1.6.0
moment.duration().weeks(); moment.duration().asWeeks();

As with the other getters for durations, moment.duration().weeks() gets the weeks (0 - 4).

moment.duration().asWeeks() gets the length of the duration in weeks.

Pay attention that unlike the other getters for duration, weeks are counted as a subset of the days, and are not taken off the days count.

Note: The length of a duration in weeks is defined as 7 days.