<commit_before>function SwatDateEntry(id)
{
	this.id = id;

	this.year = document.getElementById(id + '_year');
	this.month = document.getElementById(id + '_month');
	this.day = document.getElementById(id + '_day');

	this.swat_time = null;

	var is_ie = (document.addEventListener) ? false : true;
	var self = this;

	function handleChange(event)
	{
		var target;
		if (!event)
			var event = window.event;

		if (event.target)
			target = event.target;
		else if (event.srcElement)
			target = event.srcElement;

		// fix Safari bug
		if (target.nodeType == 3)
			target = target.parentNode;

		self.update(target);
	}

	if (is_ie) {
		if (this.year)
			this.year.attachEvent('onchange', handleChange);

		if (this.month)
			this.month.attachEvent('onchange', handleChange);

		if (this.day)
			this.day.attachEvent('onchange', handleChange);
	} else {
		if (this.year)
			this.year.addEventListener('change', handleChange, true);

		if (this.month)
			this.month.addEventListener('change', handleChange, true);

		if (this.day)
			this.day.addEventListener('change', handleChange, true);
	}

}

SwatDateEntry.prototype.setSwatTime = function(swat_time)
{
	if (typeof SwatTimeEntry != 'undefined' &&
		swat_time instanceof SwatTimeEntry) {
		this.swat_time = swat_time;
		swat_time.swat_date = this;
	}
}

SwatDateEntry.prototype.reset = function(reset_time)
{
	if (this.year)
		this.year.selectedIndex = 0;

	if (this.month)
		this.month.selectedIndex = 0;

	if (this.day)
		this.day.selectedIndex = 0;

	if (this.swat_time && reset_time)
		this.swat_time.reset(false);
}

SwatDateEntry.prototype.parseInt = function(serialized_integer)
{
	var value = parseInt(serialized_integer.replace(/[^\d]*/, ''));
	if (isNaN(value))
		return null;

	return value;
}

SwatDateEntry.prototype.getIntegerIndex = function(flydown, value)
{
	var value;
	for (i = 0; i < flydown.options.length; i++) {
		flydown_value = this.parseInt(flydown.options[i].value);
		if (flydown_value == value)
			return i;
	}
	return null;
}

SwatDateEntry.prototype.getYearIndex = function(year)<commit_msg>Tiny fixes.<commit_after>function SwatDateEntry(id)
{
	this.id = id;

	this.year = document.getElementById(id + '_year');
	this.month = document.getElementById(id + '_month');
	this.day = document.getElementById(id + '_day');

	this.swat_time = null;

	var is_ie = (document.addEventListener) ? false : true;
	var self = this;

	function handleChange(event)
	{
		var target;
		if (!event)
			var event = window.event;

		if (event.target)
			target = event.target;
		else if (event.srcElement)
			target = event.srcElement;

		// fix Safari bug
		if (target.nodeType == 3)
			target = target.parentNode;

		self.update(target);
	}

	if (is_ie) {
		if (this.year)
			this.year.attachEvent('onchange', handleChange);

		if (this.month)
			this.month.attachEvent('onchange', handleChange);

		if (this.day)
			this.day.attachEvent('onchange', handleChange);
	} else {
		if (this.year)
			this.year.addEventListener('change', handleChange, true);

		if (this.month)
			this.month.addEventListener('change', handleChange, true);

		if (this.day)
			this.day.addEventListener('change', handleChange, true);
	}
}

SwatDateEntry.prototype.setSwatTime = function(swat_time)
{
	if (typeof SwatTimeEntry != 'undefined' &&
		swat_time instanceof SwatTimeEntry) {
		this.swat_time = swat_time;
		swat_time.swat_date = this;
	}
}

SwatDateEntry.prototype.reset = function(reset_time)
{
	if (this.year)
		this.year.selectedIndex = 0;

	if (this.month)
		this.month.selectedIndex = 0;

	if (this.day)
		this.day.selectedIndex = 0;

	if (this.swat_time && reset_time)
		this.swat_time.reset(false);
}

SwatDateEntry.prototype.parseInt = function(serialized_integer)
{
	var value = parseInt(serialized_integer.replace(/[^\d]*/, ''));
	if (isNaN(value))
		return null;

	return value;
}

SwatDateEntry.prototype.getIntegerIndex = function(flydown, value)
{
	var flydown_value;
	for (i = 0; i < flydown.options.length; i++) {
		flydown_value = this.parseInt(flydown.options[i].value);
		if (flydown_value == value)
			return i;
	}
	return null;
}

SwatDateEntry.prototype.getYearIndex = function(year)
{'fraction_non_alphanumeric': 0.14120760163579504, 'fraction_numerical': 0.0024055809477988932, 'mean_word_length': 4.223618090452261, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '4871925', 'n_tokens_mistral': 1596, 'n_tokens_neox': 1467, 'n_words': 288}