<commit_before>// Modified form of `timeago` helper from https://github.com/assemble/handlebars-helpers
var YEAR = 60 * 60 * 24 * 365;
var MONTH = 60 * 60 * 24 * 30;
var DAY = 60 * 60 * 24;
var HOUR = 60 * 60;

module.exports = function( date ){
	date = new Date( date );
	var seconds = Math.floor( ( new Date() - date ) / 1000 );
	var interval = Math.floor( seconds / YEAR );
	if( interval > 1 ) return interval +' years ago';
	interval = Math.floor( seconds / MONTH );
	if( interval > 1 ) return interval +' months ago';
	interval = Math.floor( seconds / DAY );
	if( interval > 1 ) return interval +' days ago';
	interval = Math.floor( seconds / HOUR );<commit_msg>use newDate to parse date string/number in ago helper<commit_after>// Modified form of `timeago` helper from https://github.com/assemble/handlebars-helpers

var newDate = require('new-date');

var YEAR = 60 * 60 * 24 * 365;
var MONTH = 60 * 60 * 24 * 30;
var DAY = 60 * 60 * 24;
var HOUR = 60 * 60;

module.exports = function( date ){
	date = newDate( date );
	var seconds = Math.floor( ( new Date() - date ) / 1000 );
	var interval = Math.floor( seconds / YEAR );
	if( interval > 1 ) return interval +' years ago';
	interval = Math.floor( seconds / MONTH );
	if( interval > 1 ) return interval +' months ago';
	interval = Math.floor( seconds / DAY );
	if( interval > 1 ) return interval +' days ago';
	interval = Math.floor( seconds / HOUR );
{'fraction_non_alphanumeric': 0.14184397163120568, 'fraction_numerical': 0.04822695035460993, 'mean_word_length': 3.3549382716049383, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, 'https://': 2, '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': '2179516', 'n_tokens_mistral': 521, 'n_tokens_neox': 448, 'n_words': 172}