Created
June 23, 2016 13:57
-
-
Save g1eb/15d94edaf3c808bdf08a2780a0a179d6 to your computer and use it in GitHub Desktop.
Array of week indexes in current month (requires moment.js)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scope.weeks = function () { | |
var n = moment.duration( | |
moment().endOf('month') - moment().startOf('month') | |
).weeks() + 1; | |
return Array.apply(null, {length: n}).map(Number.call, Number); | |
}(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment