////////////////////////////////////////////////////////////////////////////////
// getUTCWeek and getUTCWeekYear are from:
// van den Broek, Taco. Calculate ISO 8601 week and year in javascript. Procuios. 2009-04-22. URL:http://techblog.procurios.nl/k/news/view/33796/14863/calculate-iso-8601-week-and-year-in-javascript.html. Accessed: 2015-12-07. (Archived by WebCite® at http://www.webcitation.org/6dbdvnbtj)
// Released and used under the MIT license.

// Get ISO 8601 week number for a date.
Date.prototype.getUTCWeek = function () {
	var target  = new Date(this.valueOf());
	var dayNr   = (this.getUTCDay() + 6) % 7;
	target.setUTCDate(target.getUTCDate() - dayNr + 3);
	var firstThursday = target.valueOf();
	target.setUTCMonth(0, 1);
	if (target.getUTCDay() != 4) {
		target.setUTCMonth(0, 1 + ((4 - target.getUTCDay()) + 7) % 7);
	}
	return 1 + Math.ceil((firstThursday - target) / 604800000);
}

// Get ISO 8601 year, assuming we're using week numbers.
Date.prototype.getUTCWeekYear = function () {
	var target	= new Date(this.valueOf());
	target.setUTCDate(target.getUTCDate() - ((this.getUTCDay() + 6) % 7) + 3);
	return target.getUTCFullYear();
}

// Get ISO 8610 year and week in form "2016-W01"
Date.prototype.getUTCISOWeekDate = function ()  {
	var week = this.getUTCWeek();
	week = ("0"+week).slice(-2); // Zero pad.
	var year = this.getUTCWeekYear();
	return year+"-W"+week;
}

Date.prototype.getUTCISOYearMonth = function() {
	var year = this.getUTCFullYear();
	var month = this.getUTCMonth()+1;
	month = ("0"+month).slice(-2); // Zero pad.
	return year+"-"+month;
}

Date.prototype.getUTCISOYearMonthDay = function() {
	var yearmonth = this.getUTCISOYearMonth();
	var day = this.getUTCDate();
	day = ("0"+day).slice(-2); // Zero pad.
	return yearmonth+"-"+day;
}

// Identical to "new Date(str)", but accepts ISO 8601 week dates (eg "2015-W04"). Dates are assumed to always be in UTC.
// Week dates will return midnight on the Monday morning of that week. 
Date.parseMore = function(str) {
	var fields = /^(\d\d\d\d)-W(\d\d)$/.exec(str);
	if((!fields) || fields.length !== 3) { return new Date(Date.parse(str)); }
	var year = Number(fields[1]);
	var week = Number(fields[2]);

	// Based on http://stackoverflow.com/a/19375264/16672
	var d = new Date(Date.UTC(year, 0, 1));
	var week_in_ms = 1000*60*60*24*7;
	d.setUTCDate(d.getUTCDate() + 4 - (d.getUTCDay() || 7));
	d.setTime(d.getTime() + week_in_ms * (week + (year == d.getUTCFullYear() ? -1 : 0 )));
	d.setUTCDate(d.getUTCDate() - 3);
	return d;
}

@@ -525,32 +525,47 @@
 = function () %7B%0A
+%09%22use strict%22;%0A
 %09var target  = n
@@ -585,24 +585,24 @@
 valueOf());%0A
-
 %09var dayNr  
@@ -1014,24 +1014,39 @@
 nction () %7B%0A
+%09%22use strict%22;%0A
 %09var target%09
@@ -1284,16 +1284,31 @@
 n ()  %7B%0A
+%09%22use strict%22;%0A
 %09var wee
@@ -1476,32 +1476,47 @@
  = function() %7B%0A
+%09%22use strict%22;%0A
 %09var year = this
@@ -1689,24 +1689,39 @@
 unction() %7B%0A
+%09%22use strict%22;%0A
 %09var yearmon
@@ -2046,16 +2046,16 @@
  week. %0A
-
 Date.par
@@ -2079,16 +2079,31 @@
 (str) %7B%0A
+%09%22use strict%22;%0A
 %09var fie

use strict