<commit_before>'use strict';

var React = require('react');
var Utils = require('./utils');
var Calendar = require('./calendar');

module.exports = React.createClass({
	
	displayName: 'DateInput',
	
	propTypes: {
		className: React.PropTypes.string,
		// format: React.PropTypes.string,
		setDate: React.PropTypes.func.isRequired,
		locale: React.PropTypes.shape({
			dayNames: React.PropTypes.arrayOf(React.PropTypes.string),
			monthNames: React.PropTypes.arrayOf(React.PropTypes.string)
		})//,
		// weekStart: React.PropTypes.number,
		// dateRange: React.PropTypes.shape({
		// 	firstDate: React.PropTypes.object,
		// 	lastDate: React.PropTypes.object
		// }),
		// minDate: React.PropTypes.string,
		// maxDate: React.PropTypes.string
	},
	
	getDefaultProps: function() {
		return {
			className: 'DateInput',
			// format: 'YYYY-MM-DD',
			locale: {
				dayNames: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
				monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
					'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
			}//,
			// weekStart: 1,
			// dateRange: null,
			// minDate: null,
			// maxDate: null
		};
	},
	
	getInitialState: function() {
		var initDate = Utils.cloneDate(new Date());
		
		return {
			date: initDate,
			visible: false
		};
	},
	
	setDate: function(date) {
		this.setState({ date: date });
		this.props.setDate(date);
	},
	
	setVisible: function(visible) {
		this.setState({ visible: visible });
	},
	
	onIconClick: function() {
		this.setVisible(!this.state.visible);
	},
	
	render: function() {
		return (
			<div className={this.props.className}>
				<input className={this.props.className + '__input'} />
				<div
					className={this.props.className + '__icon'}
					onClick={this.onIconClick}>
					
				</div>
				<Calendar
					className={this.props.className}
					locale={this.props.locale}
					date={this.state.date}
					setDate={this.setDate}
					setVisible={this.setVisible} />
			</div>
		);
	},
	
	styles: {
		
	}
	
});
<commit_msg>Markup and styling changes<commit_after>'use strict';

var React = require('react');
var Utils = require('./utils');
var Calendar = require('./calendar');

module.exports = React.createClass({
	
	displayName: 'DateInput',
	
	propTypes: {
		className: React.PropTypes.string,
		// format: React.PropTypes.string,
		setDate: React.PropTypes.func.isRequired,
		locale: React.PropTypes.shape({
			dayNames: React.PropTypes.arrayOf(React.PropTypes.string),
			monthNames: React.PropTypes.arrayOf(React.PropTypes.string)
		})//,
		// weekStart: React.PropTypes.number,
		// dateRange: React.PropTypes.shape({
		// 	firstDate: React.PropTypes.object,
		// 	lastDate: React.PropTypes.object
		// }),
		// minDate: React.PropTypes.string,
		// maxDate: React.PropTypes.string
	},
	
	getDefaultProps: function() {
		return {
			className: 'DateInput',
			// format: 'YYYY-MM-DD',
			locale: {
				dayNames: ['Su', 'Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa'],
				monthNames: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
					'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
			}//,
			// weekStart: 1,
			// dateRange: null,
			// minDate: null,
			// maxDate: null
		};
	},
	
	getInitialState: function() {
		var initDate = Utils.cloneDate(new Date());
		
		return {
			date: initDate,
			visible: false
		};
	},
	
	setDate: function(date) {
		this.setState({ date: date });
		this.props.setDate(date);
	},
	
	setVisible: function(visible) {
		this.setState({ visible: visible });
	},
	
	onIconClick: function() {
		this.setVisible(!this.state.visible);
	},
	
	render: function() {
		return (
			<div
				className={this.props.className}
				style={this.styles.index}>
				<div
					className={this.props.className + '__inputTable'}
					style={this.styles.inputTable}>
					<div
						className={this.props.className + '__inputCell'}
						style={this.styles.inputCell}>
						<input className={this.props.className + '__input'} />
					</div>
					<div
						className={this.props.className + '__inputCell'}
						style={this.styles.inputCell}>
						<div
							className={this.props.className + '__icon'}
							onClick={this.onIconClick}>
							
						</div>
					</div>
				</div>
				<Calendar
					className={this.props.className}
					locale={this.props.locale}
					date={this.state.date}
					setDate={this.setDate}
					setVisible={this.setVisible} />
			</div>
		);
	},
	
	styles: {
		index: {
			display: 'inline-block',
			position: 'relative'
		},
		inputTable: {
			display: 'table'
		},
		inputCell: {
			display: 'table-cell',
			verticalAlign: 'middle'
		}
	}
	
});

{'fraction_non_alphanumeric': 0.18107810781078107, 'fraction_numerical': 0.00044004400440044003, 'mean_word_length': 3.0844564240790655, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5185184', 'n_tokens_mistral': 1894, 'n_tokens_neox': 1548, 'n_words': 278}