<commit_before>function TimeUtils()
{
	this.dayLight = [];	
	for(var x=0;x<24;x++)
	{
		this.dayLight.push(1-(-Math.cos(x*2/23*Math.PI)+1)/2+((-Math.cos (x*4*Math.PI/23))+1)/10);
	}
}

TimeUtils.prototype.dayColor = function(instant, color)
{
	var x = new Date(instant).getHours();
	var color = tEngine.hexToRgb(color);
	alpha = this.dayLight[x];
	return "rgba("+color.r+","+color.g+","+color.b+","+alpha/10+")";
}

TimeUtils.toMidnight = function(instant)
{
	var midnight = new Date(instant);
    midnight.setHours( 24 );
    midnight.setMinutes( 0 );
    midnight.setSeconds( 0 );
    midnight.setMilliseconds( 0 );

    return new Date(Number(midnight)-Number(instant));
}

TimeUtils.toIntervalString = function(interval)
{
	var days = parseInt(Number(interval)/Number(TimeUtils.days(1)));
	var hours = parseInt(Number(interval)/Number(TimeUtils.hours(1)))%24;
	var minutes = parseInt(Number(interval)/Number(TimeUtils.minutes(1)))%60;
	var seconds = parseInt(Number(interval)/Number(TimeUtils.seconds(1)))%60;
	var string = days+" days "+TimeUtils.fillZeros(hours, 2)+":"+TimeUtils.fillZeros(minutes, 2)+":"+TimeUtils.fillZeros(seconds, 2);
	return string;
}

TimeUtils.dateFormatter = function(date, hours)
{
	date = new Date(date);
	var f = this.fillZeros;
	var beginStr = f(date.getDate(), 2)+"/"+f(date.getMonth()+1,2)+"/"+f(date.getFullYear(),2);
	if(typeof hours !== "undefined")
		if(hours == true)
			beginStr += f(date.getHours(),2)+":"+f(date.getMinutes(),2)+":"+f(date.getSeconds(),2);

	return beginStr;
}

TimeUtils.fillZeros = function(str, n)
{
	str = str.toString();
	while(str.length < n)
	{
		str = "0"+str;
	}
	return str;
}

TimeUtils.parseISO8601 = function (string) {
    var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
        "(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" +
        "(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";<commit_msg>Fixed: Crosshair is displaying the hours again.<commit_after>function TimeUtils()
{
	this.dayLight = [];	
	for(var x=0;x<24;x++)
	{
		this.dayLight.push(1-(-Math.cos(x*2/23*Math.PI)+1)/2+((-Math.cos (x*4*Math.PI/23))+1)/10);
	}
}

TimeUtils.prototype.dayColor = function(instant, color)
{
	var x = new Date(instant).getHours();
	var color = tEngine.hexToRgb(color);
	alpha = this.dayLight[x];
	return "rgba("+color.r+","+color.g+","+color.b+","+alpha/10+")";
}

TimeUtils.toMidnight = function(instant)
{
	var midnight = new Date(instant);
    midnight.setHours( 24 );
    midnight.setMinutes( 0 );
    midnight.setSeconds( 0 );
    midnight.setMilliseconds( 0 );

    return new Date(Number(midnight)-Number(instant));
}

TimeUtils.toIntervalString = function(interval)
{
	var days = parseInt(Number(interval)/Number(TimeUtils.days(1)));
	var hours = parseInt(Number(interval)/Number(TimeUtils.hours(1)))%24;
	var minutes = parseInt(Number(interval)/Number(TimeUtils.minutes(1)))%60;
	var seconds = parseInt(Number(interval)/Number(TimeUtils.seconds(1)))%60;
	var string = days+" days "+TimeUtils.fillZeros(hours, 2)+":"+TimeUtils.fillZeros(minutes, 2)+":"+TimeUtils.fillZeros(seconds, 2);
	return string;
}

TimeUtils.dateFormatter = function(date, hours)
{
	date = new Date(date);
	var f = this.fillZeros;
	var beginStr = f(date.getDate(), 2)+"/"+f(date.getMonth()+1,2)+"/"+f(date.getFullYear(),2);
	if(typeof hours !== "undefined")
	{
		if(hours == true)
		{
			beginStr += f(date.getHours(),2)+":"+f(date.getMinutes(),2)+":"+f(date.getSeconds(),2);
		}
	}
	else
		beginStr += " "+f(date.getHours(),2)+":"+f(date.getMinutes(),2)+":"+f(date.getSeconds(),2);


	return beginStr;
}

TimeUtils.fillZeros = function(str, n)
{
	str = str.toString();
	while(str.length < n)
	{
		str = "0"+str;
	}
	return str;
}

TimeUtils.parseISO8601 = function (string) {
    var regexp = "([0-9]{4})(-([0-9]{2})(-([0-9]{2})" +
        "(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?" +
        "(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?";
{'fraction_non_alphanumeric': 0.24147654447577543, 'fraction_numerical': 0.03819533452960779, 'mean_word_length': 5.115987460815047, 'pattern_counts': {'":': 10, '<': 7, '<?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': '7380016', 'n_tokens_mistral': 1631, 'n_tokens_neox': 1562, 'n_words': 214}