Issue 2193: ISO Week Number starting on Sunday
Status:  ExportedToGithub
Owner: ----
Closed:  Aug 2015
Reported by michael....@gmail.com, Jun 26, 2014
Correct ISO Calculation: http://jsfiddle.net/x68507/4DvUD/
Wrong ISO Calculation: http://jsfiddle.net/x68507/KmdBF/

When dealing with ISO week calculations (weekNumberCalculation:'ISO') and having a week start of Sunday (firstDay:0), the week number calculation is off by 1 week.  Technically, the ISO standard is for a week starting on Monday.  December 28, 2015 should be WEEK 53 and it is correct when "firstDay:1" but is incorrect when "firstDay:0".
Jun 26, 2014
#1 michael....@gmail.com
So I haven't tested it in all cases, but it looks like the issue is present when calling the "t.calculateWeekNumber = function(mom)" function.  The last if/else statement for 'ISO' simply calculates "mom.isoWeek()" for the given moment.  However, if "options.firstDay" isn't set to Monday, then the "mom.isoWeek()" is actually calling the previous ISO week number.  By adding the following code to the "calc.toUpperCase() === 'ISO'" statement, you should get expected behavior.  You might need to check when the locality is outside the US.

	var _coffset = 0;
	if (t.getView()['name']!='agendaDay'){
		//moves to "closest" monday of current week
		_coffset = (options.firstDay === undefined?0:options.firstDay)*-1+1;
	}
	return mom.add(_coffset,'day').isoWeek();


Jun 26, 2014
Project Member #2 adamrs...@gmail.com
(No comment was entered for this change.)
Status: Reproducing
Labels: Type-Bug
Aug 21, 2015
Project Member #3 adamrs...@gmail.com
Discussion for this issue has moved to the following URL:
https://github.com/fullcalendar/fullcalendar/issues/2458

This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event.

Happy coding,
Adam
Status: ExportedToGithub