<commit_before>var prompt = require('prompt'), 
	mongoose = require('mongoose'),
	async = require('async'),
	keypress = require('keypress-prompt'),
	str = require('date-util');

mongoose.connect('mongodb://localhost/timer');

var Entry = require('./models/entry')(mongoose);

if(process.argv.length < 3) {
	console.log('Usage: ./add.js <company> <project>');
	process.exit(1);
}

var addEntry = function(){

	var entry; //create a variable exterior to the waterfall scope to save passing it through all those callbacks

	async.waterfall([
		function(cb){
			console.log('Specify start time and decimal hours');
			prompt.start();
			prompt.get(['start', 'hours', 'commit'], cb);
			
		},
		function(res, cb) {
			var start = new Date().strtotime(res.start) * 1000; //Create a javascript timestamp  
			var end = start + (res.hours * 60 * 60 * 1000);
			console.log('Start: ', new Date(start));
			console.log('End: ', new Date(end));
			console.log('Message: ', res.commit);

			entry = new Entry({ //set the entry
				starttime: start, 
				endtime: end, 
				commit: res.commit,
				company: process.argv[2],
				project: process.argv[3]
			});

			setTimeout(cb(null, res), 0);
		},
		function(res, cb) {
			console.log('is this ok? (y/n)');
			prompt.get(['yn'], cb);
		},
		function(res, cb){
			if(res.yn == 'y') {
				entry.save(function(err){
					if(err) {
						console.err(err);
					}
					else {
						console.log('Entry saved');
						setTimeout(addEntry(), 1);
					}
				});
			}
			else {
				console.log('Entry not saved');
				addEntry();
			}
		},
	], function(err, res){
		console.error('Error', err, res);
	});
};

addEntry();
<commit_msg>Couldn't get strtotime working<commit_after>var prompt = require('prompt'), 
	mongoose = require('mongoose'),
	async = require('async'),
	keypress = require('keypress-prompt'),
	str = require('date-util');

mongoose.connect('mongodb://localhost/timer');

var Entry = require('./models/entry')(mongoose);

if(process.argv.length < 3) {
	console.log('Usage: ./add.js <company> <project>');
	process.exit(1);
}

var addEntry = function(){

	var entry; //create a variable exterior to the waterfall scope to save passing it through all those callbacks

	async.waterfall([
		function(cb){
			console.log('Specify start time and decimal hours');
			prompt.start();
			prompt.get(['start', 'hours', 'commit'], cb);
			
		},
		function(res, cb) {
			var start = res.start * 1000; //Create a javascript timestamp  
			var end = start + (res.hours * 60 * 60 * 1000);
			console.log('Start: ', new Date(start));
			console.log('End: ', new Date(end));
			console.log('Message: ', res.commit);

			entry = new Entry({ //set the entry
				starttime: start, 
				endtime: end, 
				commit: res.commit,
				company: process.argv[2],
				project: process.argv[3]
			});

			setTimeout(cb(null, res), 0);
		},
		function(res, cb) {
			console.log('is this ok? (y/n)');
			prompt.get(['yn'], cb);
		},
		function(res, cb){
			if(res.yn == 'y') {
				entry.save(function(err){
					if(err) {
						console.err(err);
					}
					else {
						console.log('Entry saved');
						setTimeout(addEntry(), 1);
					}
				});
			}
			else {
				console.log('Entry not saved');
				addEntry();
			}
		},
	], function(err, res){
		console.error('Error', err, res);
	});
};

addEntry();

{'fraction_non_alphanumeric': 0.1857099788965933, 'fraction_numerical': 0.010853180584865842, 'mean_word_length': 3.253846153846154, 'pattern_counts': {'":': 0, '<': 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': '6727108', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1113, 'n_words': 266}