Преглед на файлове

rename to weekNumbersWithinDays

Adam Shaw преди 9 години
родител
ревизия
76359df58d
променени са 4 файла, в които са добавени 49 реда и са изтрити 48 реда
  1. 1 0
      CHANGELOG.md
  2. 1 1
      demos/week-numbers.html
  3. 1 1
      src/basic/BasicView.js
  4. 46 46
      tests/automated/weekNumbers.js

+ 1 - 0
CHANGELOG.md

@@ -5,6 +5,7 @@ v3.0.0-beta (2016-08-14)
 Features:
 - List View (#560)
 - Option to display week numbers in cells (#3024)
+   (new weekNumbersWithinDays option)
 - When week calc is ISO, default first day-of-week to Monday (#3255)
 - Macedonian language (#2739)
 

+ 1 - 1
demos/week-numbers.html

@@ -14,7 +14,7 @@
 		$('#calendar').fullCalendar({
 
 			weekNumbers: true,
-			weekNumberColumn: 'auto', // TODO: weekNumbersWithinDays: true,
+			weekNumbersWithinDays: true,
 			weekNumberCalculation: 'ISO',
 
 			header: {

+ 1 - 1
src/basic/BasicView.js

@@ -75,7 +75,7 @@ var BasicView = FC.BasicView = View.extend({
 
 		this.dayNumbersVisible = this.dayGrid.rowCnt > 1; // TODO: make grid responsible
 		if (this.opt('weekNumbers')) {
-			if (this.opt('weekNumberColumn') === 'auto') {
+			if (this.opt('weekNumbersWithinDays')) {
 				this.cellWeekNumbersVisible = true;
 				this.colWeekNumbersVisible = false;
 			}

+ 46 - 46
tests/automated/weekNumbers.js

@@ -21,26 +21,26 @@ describe('weekNumbers', function() {
 			options.weekMode = 'fixed'; // will make 6 rows
 		});
 
-		describe('with default weekNumbers', function() {
+		describe('with default weekNumbers', function() { // which is false!
 
-			describe('and default weekNumberColumn', function() {
+			describe('and default weekNumbersWithinDays', function() {
 				it('should not display week numbers at all', function() {
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
 			});
 
-			describe('and weekNumberColumn set to true', function() {
+			describe('and weekNumbersWithinDays set to false', function() {
 				it('should not display week numbers at all', function() {
-					options.weekNumberColumn = true;
+					options.weekNumbersWithinDays = false;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
 			});
 
-			describe('and weekNumberColumn set to auto', function() {
+			describe('and weekNumbersWithinDays set to true', function() {
 				it('should not display week numbers at all', function() {
-					options.weekNumberColumn = 'auto';
+					options.weekNumbersWithinDays = true;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
@@ -54,24 +54,24 @@ describe('weekNumbers', function() {
 				options.weekNumbers = false;
 			});
 
-			describe('and default weekNumberColumn', function() {
+			describe('and default weekNumbersWithinDays', function() {
 				it('should not display week numbers at all', function() {
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
 			});
 
-			describe('and weekNumberColumn set to true', function() {
+			describe('and weekNumbersWithinDays set to false', function() {
 				it('should not display week numbers at all', function() {
-					options.weekNumberColumn = true;
+					options.weekNumbersWithinDays = false;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
 			});
 
-			describe('and weekNumberColumn set to auto', function() {
+			describe('and weekNumbersWithinDays set to true', function() {
 				it('should not display week numbers at all', function() {
-					options.weekNumberColumn = 'auto';
+					options.weekNumbersWithinDays = true;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
@@ -85,7 +85,7 @@ describe('weekNumbers', function() {
 				options.weekNumbers = true;
 			});
 
-			describe('and default weekNumberColumn', function() {
+			describe('and default weekNumbersWithinDays', function() {
 				it('should display week numbers along the side only', function() {
 					counts = getCounts();
 					// TODO: Is it possible to remove class fc-week-number from
@@ -97,9 +97,9 @@ describe('weekNumbers', function() {
 				});
 			});
 
-			describe('and weekNumberColumn set to true', function() {
+			describe('and weekNumbersWithinDays set to false', function() {
 				it('should display week numbers along the side only', function() {
-					options.weekNumberColumn = true;
+					options.weekNumbersWithinDays = false;
 					counts = getCounts();
 					// TODO: Is it possible to remove class fc-week-number from
 					// headers and fillers, bringing allWeekNumbers down to 6?
@@ -110,9 +110,9 @@ describe('weekNumbers', function() {
 				});
 			});
 
-			describe('and weekNumberColumn set to auto', function() {
+			describe('and weekNumbersWithinDays set to true', function() {
 				it('should display week numbers in the day cells only', function() {
-					options.weekNumberColumn = 'auto';
+					options.weekNumbersWithinDays = true;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(6);
 					expect(counts.colWeekNumbers).toEqual(0);
@@ -133,24 +133,24 @@ describe('weekNumbers', function() {
 
 		describe('with default weekNumbers', function() {
 
-			describe('and default weekNumberColumn', function() {
+			describe('and default weekNumbersWithinDays', function() {
 				it('should not display week numbers at all', function() {
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
 			});
 
-			describe('and weekNumberColumn set to true', function() {
+			describe('and weekNumbersWithinDays set to false', function() {
 				it('should not display week numbers at all', function() {
-					options.weekNumberColumn = true;
+					options.weekNumbersWithinDays = false;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
 			});
 
-			describe('and weekNumberColumn set to auto', function() {
+			describe('and weekNumbersWithinDays set to true', function() {
 				it('should not display week numbers at all', function() {
-					options.weekNumberColumn = 'auto';
+					options.weekNumbersWithinDays = true;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
@@ -164,24 +164,24 @@ describe('weekNumbers', function() {
 				options.weekNumbers = false;
 			});
 
-			describe('and default weekNumberColumn', function() {
+			describe('and default weekNumbersWithinDays', function() {
 				it('should not display week numbers at all', function() {
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
 			});
 
-			describe('and weekNumberColumn set to true', function() {
+			describe('and weekNumbersWithinDays set to false', function() {
 				it('should not display week numbers at all', function() {
-					options.weekNumberColumn = true;
+					options.weekNumbersWithinDays = false;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
 			});
 
-			describe('and weekNumberColumn set to auto', function() {
+			describe('and weekNumbersWithinDays set to true', function() {
 				it('should not display week numbers at all', function() {
-					options.weekNumberColumn = 'auto';
+					options.weekNumbersWithinDays = true;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
@@ -195,7 +195,7 @@ describe('weekNumbers', function() {
 				options.weekNumbers = true;
 			});
 
-			describe('and default weekNumberColumn', function() {
+			describe('and default weekNumbersWithinDays', function() {
 				it('should display week numbers along the side only', function() {
 					counts = getCounts();
 					// TODO: Is it possible to remove class fc-week-number from
@@ -207,9 +207,9 @@ describe('weekNumbers', function() {
 				});
 			});
 
-			describe('and weekNumberColumn set to true', function() {
+			describe('and weekNumbersWithinDays set to false', function() {
 				it('should display week numbers along the side only', function() {
-					options.weekNumberColumn = true;
+					options.weekNumbersWithinDays = false;
 					counts = getCounts();
 					// TODO: Is it possible to remove class fc-week-number from
 					// headers and fillers, bringing allWeekNumbers down to 1?
@@ -220,9 +220,9 @@ describe('weekNumbers', function() {
 				});
 			});
 
-			describe('and weekNumberColumn set to auto', function() {
+			describe('and weekNumbersWithinDays set to true', function() {
 				it('should display week numbers in the day cells only', function() {
-					options.weekNumberColumn = 'auto';
+					options.weekNumbersWithinDays = true;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(1);
 					expect(counts.colWeekNumbers).toEqual(0);
@@ -243,24 +243,24 @@ describe('weekNumbers', function() {
 
 		describe('with default weekNumbers', function() {
 
-			describe('and default weekNumberColumn', function() {
+			describe('and default weekNumbersWithinDays', function() {
 				it('should not display week numbers at all', function() {
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
 			});
 
-			describe('and weekNumberColumn set to true', function() {
+			describe('and weekNumbersWithinDays set to false', function() {
 				it('should not display week numbers at all', function() {
-					options.weekNumberColumn = true;
+					options.weekNumbersWithinDays = false;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
 			});
 
-			describe('and weekNumberColumn set to auto', function() {
+			describe('and weekNumbersWithinDays set to true', function() {
 				it('should not display week numbers at all', function() {
-					options.weekNumberColumn = 'auto';
+					options.weekNumbersWithinDays = true;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
@@ -274,24 +274,24 @@ describe('weekNumbers', function() {
 				options.weekNumbers = false;
 			});
 
-			describe('and default weekNumberColumn', function() {
+			describe('and default weekNumbersWithinDays', function() {
 				it('should not display week numbers at all', function() {
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
 			});
 
-			describe('and weekNumberColumn set to true', function() {
+			describe('and weekNumbersWithinDays set to false', function() {
 				it('should not display week numbers at all', function() {
-					options.weekNumberColumn = true;
+					options.weekNumbersWithinDays = false;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
 			});
 
-			describe('and weekNumberColumn set to auto', function() {
+			describe('and weekNumbersWithinDays set to true', function() {
 				it('should not display week numbers at all', function() {
-					options.weekNumberColumn = 'auto';
+					options.weekNumbersWithinDays = true;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(0);
 				});
@@ -305,7 +305,7 @@ describe('weekNumbers', function() {
 				options.weekNumbers = true;
 			});
 
-			describe('and default weekNumberColumn', function() {
+			describe('and default weekNumbersWithinDays', function() {
 				it('should display week numbers in the top left corner only', function() {
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(1);
@@ -315,9 +315,9 @@ describe('weekNumbers', function() {
 				});
 			});
 
-			describe('and weekNumberColumn set to true', function() {
+			describe('and weekNumbersWithinDays set to false', function() {
 				it('should display week numbers in the top left corner only', function() {
-					options.weekNumberColumn = true;
+					options.weekNumbersWithinDays = false;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(1);
 					expect(counts.colWeekNumbers).toEqual(0);
@@ -326,9 +326,9 @@ describe('weekNumbers', function() {
 				});
 			});
 
-			describe('and weekNumberColumn set to auto', function() {
+			describe('and weekNumbersWithinDays set to true', function() {
 				it('should display week numbers in the top left corner only', function() {
-					options.weekNumberColumn = 'auto';
+					options.weekNumbersWithinDays = true;
 					counts = getCounts();
 					expect(counts.allWeekNumbers).toEqual(1);
 					expect(counts.colWeekNumbers).toEqual(0);