From cf3d9288c97e65fdc66500b5bdc18604f97f0b85 Mon Sep 17 00:00:00 2001 From: Simon Egersand <s.egersand@gmail.com> Date: Thu, 03 Aug 2017 18:52:09 +0200 Subject: [PATCH] Use same tab indentiation in all JS files --- src/MonthsView.js | 12 +++--- src/TimeView.js | 14 +++--- src/CalendarContainer.js | 18 ++++---- src/DaysView.js | 16 ++++---- src/YearsView.js | 14 +++--- DateTime.js | 21 +++++----- 6 files changed, 47 insertions(+), 48 deletions(-) diff --git a/DateTime.js b/DateTime.js index 421cd04..4d1d9f6 100644 --- a/DateTime.js +++ b/DateTime.js @@ -2,11 +2,11 @@ var assign = require('object-assign'), PropTypes = require('prop-types'), - createClass = require('create-react-class'), + createClass = require('create-react-class'), moment = require('moment'), React = require('react'), CalendarContainer = require('./src/CalendarContainer') -; + ; var TYPES = PropTypes; var Datetime = createClass({ @@ -68,7 +68,7 @@ var formats = this.getFormats( props ), date = props.value || props.defaultValue, selectedDate, viewDate, updateOn, inputValue - ; + ; if ( date && typeof date === 'string' ) selectedDate = this.localMoment( date, formats.datetime ); @@ -103,7 +103,7 @@ }, getUpdateOn: function( formats ) { - if ( formats.date.match(/[lLD]/) ) { + if ( formats.date.match(/[lLD]/) ) { return 'days'; } else if ( formats.date.indexOf('M') !== -1 ) { return 'months'; @@ -120,7 +120,7 @@ time: props.timeFormat || '' }, locale = this.localMoment( props.date, null, props ).localeData() - ; + ; if ( formats.date === true ) { formats.date = locale.longDateFormat('L'); @@ -200,7 +200,7 @@ var value = e.target === null ? e : e.target.value, localMoment = this.localMoment( value, this.state.inputFormat ), update = { inputValue: value } - ; + ; if ( localMoment.isValid() && !this.props.value ) { update.selectedDate = localMoment; @@ -272,7 +272,7 @@ state = this.state, date = (state.selectedDate || state.viewDate).clone(), nextType - ; + ; // It is needed to set all the time properties // to not to reset the time @@ -297,7 +297,7 @@ viewDate = this.state.viewDate, currentDate = this.state.selectedDate || viewDate, date - ; + ; if (target.className.indexOf('rdtDay') !== -1) { if (target.className.indexOf('rdtNew') !== -1) @@ -386,7 +386,7 @@ var me = this, formats = this.getFormats( this.props ), props = {dateFormat: formats.date, timeFormat: formats.time} - ; + ; this.componentProps.fromProps.forEach( function( name ) { props[ name ] = me.props[ name ]; @@ -407,8 +407,7 @@ var className = 'rdt' + (this.props.className ? ( Array.isArray( this.props.className ) ? ' ' + this.props.className.join( ' ' ) : ' ' + this.props.className) : ''), - children = [] - ; + children = []; if ( this.props.input ) { children = [ React.createElement('input', assign({ diff --git a/src/CalendarContainer.js b/src/CalendarContainer.js index e38b834..f7cf18e 100644 --- a/src/CalendarContainer.js +++ b/src/CalendarContainer.js @@ -1,12 +1,12 @@ 'use strict'; var React = require('react'), - createClass = require('create-react-class'), - DaysView = require('./DaysView'), - MonthsView = require('./MonthsView'), - YearsView = require('./YearsView'), - TimeView = require('./TimeView') -; + createClass = require('create-react-class'), + DaysView = require('./DaysView'), + MonthsView = require('./MonthsView'), + YearsView = require('./YearsView'), + TimeView = require('./TimeView') + ; var CalendarContainer = createClass({ viewComponents: { @@ -16,9 +16,9 @@ time: TimeView }, - render: function() { - return React.createElement( this.viewComponents[ this.props.view ], this.props.viewProps ); - } + render: function() { + return React.createElement( this.viewComponents[ this.props.view ], this.props.viewProps ); + } }); module.exports = CalendarContainer; diff --git a/src/DaysView.js b/src/DaysView.js index 5654ca8..0597399 100644 --- a/src/DaysView.js +++ b/src/DaysView.js @@ -1,10 +1,10 @@ 'use strict'; var React = require('react'), - createClass = require('create-react-class'), + createClass = require('create-react-class'), moment = require('moment'), onClickOutside = require('react-onclickoutside') -; + ; var DateTimePickerDays = onClickOutside( createClass({ render: function() { @@ -12,7 +12,7 @@ date = this.props.viewDate, locale = date.localeData(), tableChildren - ; + ; tableChildren = [ React.createElement('thead', { key: 'th' }, [ @@ -44,7 +44,7 @@ first = locale.firstDayOfWeek(), dow = [], i = 0 - ; + ; days.forEach( function( day ) { dow[ (7 + ( i++ ) - first) % 7 ] = day; @@ -64,7 +64,7 @@ renderer = this.props.renderDay || this.renderDay, isValid = this.props.isValidDate || this.alwaysValidDate, classes, isDisabled, dayProps, currentDate - ; + ; // Go to the last week of the previous month prevMonth.date( prevMonth.daysInMonth() ).startOf( 'week' ); @@ -136,9 +136,9 @@ return 1; }, - handleClickOutside: function() { - this.props.handleClickOutside(); - } + handleClickOutside: function() { + this.props.handleClickOutside(); + } })); module.exports = DateTimePickerDays; diff --git a/src/MonthsView.js b/src/MonthsView.js index c1ff2a0..428769c 100644 --- a/src/MonthsView.js +++ b/src/MonthsView.js @@ -1,9 +1,9 @@ 'use strict'; var React = require('react'), - createClass = require('create-react-class'), + createClass = require('create-react-class'), onClickOutside = require('react-onclickoutside') -; + ; var DateTimePickerMonths = onClickOutside( createClass({ render: function() { @@ -29,7 +29,7 @@ classes, props, currentMonth, isDisabled, noOfDaysInMonth, daysInMonth, validDay, // Date is irrelevant because we're only interested in month irrelevantDate = 1 - ; + ; while (i < 12) { classes = 'rdtMonth'; @@ -95,9 +95,9 @@ return 1; }, - handleClickOutside: function() { - this.props.handleClickOutside(); - } + handleClickOutside: function() { + this.props.handleClickOutside(); + } })); function capitalize( str ) { diff --git a/src/TimeView.js b/src/TimeView.js index c9c6159..7a0ca7f 100644 --- a/src/TimeView.js +++ b/src/TimeView.js @@ -1,10 +1,10 @@ 'use strict'; var React = require('react'), - createClass = require('create-react-class'), + createClass = require('create-react-class'), assign = require('object-assign'), - onClickOutside = require('react-onclickoutside') -; + onClickOutside = require('react-onclickoutside') + ; var DateTimePickerTime = onClickOutside( createClass({ getInitialState: function() { @@ -15,7 +15,7 @@ var date = props.selectedDate || props.viewDate, format = props.timeFormat, counters = [] - ; + ; if ( format.toLowerCase().indexOf('h') !== -1 ) { counters.push('hours'); @@ -220,9 +220,9 @@ return str; }, - handleClickOutside: function() { - this.props.handleClickOutside(); - } + handleClickOutside: function() { + this.props.handleClickOutside(); + } })); module.exports = DateTimePickerTime; diff --git a/src/YearsView.js b/src/YearsView.js index 5344cb7..8e7b799 100644 --- a/src/YearsView.js +++ b/src/YearsView.js @@ -1,9 +1,9 @@ 'use strict'; var React = require('react'), - createClass = require('create-react-class'), + createClass = require('create-react-class'), onClickOutside = require('react-onclickoutside') -; + ; var DateTimePickerYears = onClickOutside( createClass({ render: function() { @@ -14,7 +14,7 @@ React.createElement('th', { key: 'prev', className: 'rdtPrev', onClick: this.props.subtractTime( 10, 'years' )}, React.createElement('span', {}, '���' )), React.createElement('th', { key: 'year', className: 'rdtSwitch', onClick: this.props.showView( 'years' ), colSpan: 2 }, year + '-' + ( year + 9 ) ), React.createElement('th', { key: 'next', className: 'rdtNext', onClick: this.props.addTime( 10, 'years' )}, React.createElement('span', {}, '���' )) - ]))), + ]))), React.createElement('table', { key: 'years' }, React.createElement('tbody', {}, this.renderYears( year ))) ]); }, @@ -31,7 +31,7 @@ // we're only interested in the year irrelevantMonth = 0, irrelevantDate = 1 - ; + ; year--; while (i < 11) { @@ -97,9 +97,9 @@ return 1; }, - handleClickOutside: function() { - this.props.handleClickOutside(); - } + handleClickOutside: function() { + this.props.handleClickOutside(); + } })); module.exports = DateTimePickerYears; -- Gitblit v1.9.3