<commit_before>angular
	.module('foosey')
	.filter('and', and)
	.filter('capitalize', capitalize)
	.filter('date', date)
	.filter('eloChange', eloChange)
	.filter('team', team)
	.filter('time', time)
	.filter('percentage', percentage);

// replace & with And
function and()
{
	return function(str)
	{
		return str.split('&').join(' & ');
	}
}

// capitalize the first letter of a word
function capitalize() 
{
  return function(input) {
    return !input ? '' : input.toLowerCase().replace( /\b\w/g, function (m) {
      return m.toUpperCase();
    });
  }
}

// format date
function date() 
{
  return function(input) {
    var day = moment(input);
  	var daysFromToday = moment().diff(day, 'days');
	  
    // Special cases
    if (daysFromToday === 0) return 'Today';
    if (daysFromToday === 1) return 'Yesterday';
    if (daysFromToday < 7) return day.format('dddd');

    return input;
  }
}

// format the elo change for the day
function eloChange()
{
	return function(input)
	{
		if (input === undefined || input === null) return '';
		plusOrMinus = input < 0 ? input : '+' + input
		return '(' + plusOrMinus + ')';
	}
}

// nice string for teams
function team()
{
	return function(players)
	{
		// for one or two players
		if (players.length === 1) return players[0].name;
		if (players.length === 2) return players[0].name + " and " + players[1].name;

		// else, comma seperated list
		var teamName = "";
		var i = 0;
		while(i < players.length)
		{
			// if last one, add and with no comma
			if (i + 1 === players.length)
				teamName += "and " + players[i].name;
			else
				teamName += players[i].name + ", ";
			i++;
		}
		return teamName;
	}
}

// convert from 24-hour to am/pm
function time()
{
	return function(input)
	{
		var day = moment.unix(input);
    var daysFromToday = moment().diff(day, 'days');

	}
}

function percentage($filter) {
  return function (input, decimals) 
  {
    return $filter('number')(input * 100, decimals) + '%';<commit_msg>Actually fixed time filter<commit_after>angular
	.module('foosey')
	.filter('and', and)
	.filter('capitalize', capitalize)
	.filter('date', date)
	.filter('eloChange', eloChange)
	.filter('team', team)
	.filter('time', time)
	.filter('percentage', percentage);

// replace & with And
function and()
{
	return function(str)
	{
		return str.split('&').join(' & ');
	}
}

// capitalize the first letter of a word
function capitalize() 
{
  return function(input) {
    return !input ? '' : input.toLowerCase().replace( /\b\w/g, function (m) {
      return m.toUpperCase();
    });
  }
}

// format date
function date() 
{
  return function(input) {
    var day = moment(input);
  	var daysFromToday = moment().diff(day, 'days');
	  
    // Special cases
    if (daysFromToday === 0) return 'Today';
    if (daysFromToday === 1) return 'Yesterday';
    if (daysFromToday < 7) return day.format('dddd');

    return input;
  }
}

// format the elo change for the day
function eloChange()
{
	return function(input)
	{
		if (input === undefined || input === null) return '';
		plusOrMinus = input < 0 ? input : '+' + input
		return '(' + plusOrMinus + ')';
	}
}

// nice string for teams
function team()
{
	return function(players)
	{
		// for one or two players
		if (players.length === 1) return players[0].name;
		if (players.length === 2) return players[0].name + " and " + players[1].name;

		// else, comma seperated list
		var teamName = "";.
		var i = 0;
		while(i < players.length)
		{
			// if last one, add and with no comma
			if (i + 1 === players.length)
				teamName += "and " + players[i].name;
			else
				teamName += players[i].name + ", ";
			i++;
		}
		return teamName;
	}
}

// convert from 24-hour to am/pm
function time()
{
	return function(input)
	{
		var day = moment.unix(input);
    var daysFromToday = moment().diff(day, 'days');
    var absolutelyToday = daysFromToday === 0 && day.dayOfYear() === moment().dayOfYear();

		return absolutelyToday ? day.fromNow() : day.format('h:mma');
	}
}

function percentage($filter) {
  return function (input, decimals) 
  {
    return $filter('number')(input * 100, decimals) + '%';
{'fraction_non_alphanumeric': 0.17172698566917657, 'fraction_numerical': 0.00801554529997571, 'mean_word_length': 3.2322713257965057, 'pattern_counts': {'":': 0, '<': 9, '<?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': '7119938', 'n_tokens_mistral': 1526, 'n_tokens_neox': 1403, 'n_words': 379}