<commit_before>var base_url="{{ globals.base_url }}",
	base_static="{{ globals.base_static }}",
	mobile_client = false,
	is_mobile = {{ globals.mobile }},
	touchable = false,
	base_key, link_id = 0, user_id, user_login;


var now = (new Date);
var now_ts = now.getTime();

function to_date(index) {
		var str = "";
		var $e = $(this);
		var ts = $e.data('ts');
		if (typeof ts != 'number' || ! ts > 0) {
			return;
		}

		ts *= 1000;

		var d = new Date(ts);

		var dd = function (d) {
			if (d < 10) return "0"+d;
			else return d;
		};

		if (now_ts - ts < 60000) {
			str = "{% trans _('hace') %} " + Math.floor((now_ts - ts)/1000) + " {% trans _('seg') %}";
		} else if (now_ts - ts < 3600000) {
			str = "{% trans _('hace') %} " + Math.floor((now_ts - ts)/60000) + " {% trans _('min') %}";
		} else {
			if (now.getDay() != d.getDay() ) {
				str += dd(d.getDate())+"/"+dd(d.getMonth() + 1)
			}
			if (now.getFullYear() != d.getFullYear()) {
				str += "/"+d.getFullYear();
			}
			str += " " + dd(d.getHours())+":"+dd(d.getMinutes());<commit_msg>Added controls to avoid negatives seconds and optimized<commit_after>var base_url="{{ globals.base_url }}",
	base_static="{{ globals.base_static }}",
	mobile_client = false,
	is_mobile = {{ globals.mobile }},
	touchable = false,
	base_key, link_id = 0, user_id, user_login;


var now = (new Date);
var now_ts = now.getTime();

function to_date(index) {
		var str;
		var $e = $(this);
		var ts = $e.data('ts');
		if (typeof ts != 'number' || ! ts > 0) {
			return;
		}

		ts *= 1000;

		var d = new Date(ts);

		var dd = function (d) {
			if (d < 10) return "0"+d;
			else return d;
		};

		var diff = Math.floor((now_ts - ts)/1000);
		if (diff < 3600 && diff > 0) {
			if (diff < 60) {
				str = "{% trans _('hace') %} " + diff + " {% trans _('seg') %}";
			} else {
				str = "{% trans _('hace') %} " + Math.floor(diff/60) + " {% trans _('min') %}";
			}
		} else {
			str = "";
			if (diff > 43200 ) { /* 12 hs */
				str += dd(d.getDate())+"/"+dd(d.getMonth() + 1)
			}
			if (now.getFullYear() != d.getFullYear()) {
				str += "/"+d.getFullYear();
			}
			str += " " + dd(d.getHours())+":"+dd(d.getMinutes());
{'fraction_non_alphanumeric': 0.2299168975069252, 'fraction_numerical': 0.02816251154201293, 'mean_word_length': 2.925724637681159, 'pattern_counts': {'":': 2, '<': 9, '<?xml version=': 0, '>': 7, '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': '5903758', 'n_tokens_mistral': 1030, 'n_tokens_neox': 863, 'n_words': 201}