Module

getWeekOfYear

Based on information at: http://www.merlyn.demon.co.uk/weekcalc.htm#WNR Algorithm is to find nearest thursday, it's year is the year of the week number. Then get weeks between that date and the first day of that year. Note that dates in one year can be weeks of previous or next year, overlap is up to 3 days. e.g. 2014/12/29 is Monday in week 1 of 2015 2012/1/1 is Sunday in week 52 of 2011
Parameters:
Name Type Description
d
Author:
  • https://stackoverflow.com/a/6117889/9428719

View Source dateTime/getWeekOfYear.js, line 6