diff --git a/build/jscs.conf.js b/build/jscs.conf.js index 77d8a55..5cdadf8 100644 --- a/build/jscs.conf.js +++ b/build/jscs.conf.js @@ -45,6 +45,9 @@ module.exports = { src: 'tests/automated/*.js' }, - misc: '*.js' // config files in root + misc: [ + '*.js', // ex: Gruntfile.js + 'build/*.js' // ex: this file + ] }; \ No newline at end of file diff --git a/build/jshint.conf.js b/build/jshint.conf.js index cb0df3d..e6fad80 100644 --- a/build/jshint.conf.js +++ b/build/jshint.conf.js @@ -8,6 +8,7 @@ module.exports = { moment: false, jQuery: false }, + es3: true, bitwise: true, camelcase: true, curly: true, diff --git a/src/agenda/AgendaView.js b/src/agenda/AgendaView.js index 78e12c5..8a73c27 100644 --- a/src/agenda/AgendaView.js +++ b/src/agenda/AgendaView.js @@ -572,7 +572,7 @@ function AgendaView(element, calendar, viewName) { var date = cellToDate(0, col); var match = this.parentNode.className.match(/fc-slot(\d+)/); // TODO: maybe use data if (match) { - var slotIndex = parseInt(match[1]); + var slotIndex = parseInt(match[1], 10); date.add(minTime + slotIndex * slotDuration); date = calendar.rezoneDate(date); trigger( diff --git a/tests/automated/columnFormat.js b/tests/automated/columnFormat.js index f1f79a9..e13d8d5 100644 --- a/tests/automated/columnFormat.js +++ b/tests/automated/columnFormat.js @@ -45,7 +45,7 @@ describe('columnFormat', function() { agendaDay: 'dddd M/D', agendaWeek: 'dddd D , M', basicDay: 'dddd D | M', - basicWeek: 'dddd D - M', + basicWeek: 'dddd D - M' } }); }); diff --git a/tests/automated/dayNames.js b/tests/automated/dayNames.js index 9c6ad81..36f6975 100644 --- a/tests/automated/dayNames.js +++ b/tests/automated/dayNames.js @@ -11,7 +11,7 @@ describe('day names', function() { '.fc-wed', '.fc-thu', '.fc-fri', - '.fc-sat', + '.fc-sat' ]; var referenceDate = '2014-05-25 06:00'; // A sunday var languages = [ 'es', 'fr', 'de', 'zh-cn', 'nl' ]; diff --git a/tests/automated/dayNamesShort.js b/tests/automated/dayNamesShort.js index 89f65f5..a17805d 100644 --- a/tests/automated/dayNamesShort.js +++ b/tests/automated/dayNamesShort.js @@ -3,7 +3,7 @@ describe('short day names', function() { var testableClasses = [ 'month', 'agendaWeek', - 'basicWeek', + 'basicWeek' ]; var dayClasses = [ '.fc-sun', diff --git a/tests/automated/moment-query.js b/tests/automated/moment-query.js index 20d407e..02d1948 100644 --- a/tests/automated/moment-query.js +++ b/tests/automated/moment-query.js @@ -4,7 +4,7 @@ var momentTypeSuffixes = { 'ambiguously-timed': '', 'ambiguously-zoned': 'T00:30:00', - timed: 'T00:30:00-0500', + timed: 'T00:30:00-0500' }; describe('isWithin', function() { diff --git a/tests/automated/updateEvent.js b/tests/automated/updateEvent.js index d25357f..7fbaea2 100644 --- a/tests/automated/updateEvent.js +++ b/tests/automated/updateEvent.js @@ -360,7 +360,7 @@ describe('updateEvent', function() { beforeEach(function() { options.events = [ { id: '1', start: '2014-05-01T06:00:00+05:00', end: '2014-05-03T06:00:00+05:00', allDay: false }, - { id: '1', start: '2014-05-11T06:00:00+05:00', end: '2014-05-13T06:00:00+05:00', allDay: false }, + { id: '1', start: '2014-05-11T06:00:00+05:00', end: '2014-05-13T06:00:00+05:00', allDay: false } ]; init(); event.end.add('hours', 2); diff --git a/tests/automated/weekMode.js b/tests/automated/weekMode.js index e1b83da..0dfbcca 100644 --- a/tests/automated/weekMode.js +++ b/tests/automated/weekMode.js @@ -29,11 +29,11 @@ describe('weekMode', function() { }); it('should not change height whether 4,5 or weeks', function() { $('#cal').fullCalendar('gotoDate', '2009-02-01'); - var fourWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var fourWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); $('#cal').fullCalendar('gotoDate', '2013-10-01'); - var fiveWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var fiveWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); $('#cal').fullCalendar('gotoDate', '2013-06-01'); - var sixWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var sixWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); expect(fourWeekHeight).toEqual(fiveWeekHeight); expect(fiveWeekHeight).toEqual(sixWeekHeight); }); @@ -85,30 +85,30 @@ describe('weekMode', function() { }); it('should increase height when moving from 6 week to 5 weeks', function() { $('#cal').fullCalendar('gotoDate', '2013-10-01'); - var fiveWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var fiveWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); $('#cal').fullCalendar('gotoDate', '2013-06-01'); - var sixWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var sixWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); expect(fiveWeekHeight).toBeGreaterThan(sixWeekHeight); }); it('should reduce height when moving from 5 weeks to 6 weeks', function() { $('#cal').fullCalendar('gotoDate', '2013-06-01'); - var sixWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var sixWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); $('#cal').fullCalendar('gotoDate', '2013-10-01'); - var fiveWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var fiveWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); expect(fiveWeekHeight).toBeGreaterThan(sixWeekHeight); }); it('should increase height when moving from 5 weeks to 4 weeks', function() { $('#cal').fullCalendar('gotoDate', '2013-05-01'); - var fiveWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var fiveWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); $('#cal').fullCalendar('gotoDate', '2009-02-01'); - var fourWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var fourWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); expect(fourWeekHeight).toBeGreaterThan(fiveWeekHeight); }); it('should reduce height when moving from 4 weeks to 5 weeks', function() { $('#cal').fullCalendar('gotoDate', '2009-02-01'); - var fourWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var fourWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); $('#cal').fullCalendar('gotoDate', '2013-05-01'); - var fiveWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var fiveWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); expect(fourWeekHeight).toBeGreaterThan(fiveWeekHeight); }); }); @@ -136,11 +136,11 @@ describe('weekMode', function() { }); it('should not change height whether 4,5 or weeks', function() { $('#cal').fullCalendar('gotoDate', '2009-02-01'); - var fourWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var fourWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); $('#cal').fullCalendar('gotoDate', '2013-10-01'); - var fiveWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var fiveWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); $('#cal').fullCalendar('gotoDate', '2013-06-01'); - var sixWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height')); + var sixWeekHeight = parseInt($('.fc-week.fc-first .fc-first.fc-day div').css('min-height'), 10); expect(fourWeekHeight).toEqual(fiveWeekHeight); expect(fiveWeekHeight).toEqual(sixWeekHeight); }); diff --git a/tests/automated/weekNumberCalculation.js b/tests/automated/weekNumberCalculation.js index 2f17a9c..25a8879 100644 --- a/tests/automated/weekNumberCalculation.js +++ b/tests/automated/weekNumberCalculation.js @@ -12,7 +12,7 @@ describe('weekNumberCalculation', function() { function getRenderedWeekNumber() { // works for both kinds of views var text = $('.fc-agenda-axis.fc-week-number, .fc-week:first .fc-week-number').text(); - return parseInt(text.replace(/\D/g, '')); + return parseInt(text.replace(/\D/g, ''), 10); } beforeEach(function() {