How do I get the current weeknumber of the year, like PHP\'s date(\'W\')
?
It should be the ISO-8601 week number of year, weeks starting
Jacob Wright's Date.format() library implements date formatting in the style of PHP's date() function and supports the ISO-8601 week number:
new Date().format('W');
It may be a bit overkill for just a week number, but it does support PHP style formatting and is quite handy if you'll be doing a lot of this.