var formatUptime = function(uptime){
	var unit = 'seconde';
  var days;
	if(uptime >= 1.5){
		unit = unit + 'n';
	}
	if(uptime > 60) {
		uptime = uptime / 60;
		unit = 'minuut';
		if(uptime >= 1.5){
			unit = 'minuten';
		}
    if(uptime > 60) {
      uptime = uptime / 60;
      unit = 'uur';
      if(uptime > 24) {
        days = uptime / 24;
        unit = 'dag';
        if(uptime >= 1.5){
          unit = unit + 'en';
        }
      }
    }
	}
  if(days) {
    uptime = Math.floor(days) + ' ' + unit + ' en ' + Math.round(uptime-Math.floor(days)*24) + ' uur';
  }else{
    uptime = Math.round(uptime) + ' ' + unit;
  }
	return uptime;
};

var verifyDate = function(text){
  var date;
  var current_date;
  var split;
  if (text == "vandaag" || text == "Vandaag"){
    date = new Date();
  }else if(text == "morgen" || text == "Morgen"){
    date = new Date();
    date.setDate(date.getDate() + 1);
  }else if(text == "Volgende week" || text == "volgende week" || text == "Week" || text == "week"){
    date = new Date();
    date.setDate(date.getDate() + 7);
  }else if(text == "Over een maand" || text == "over een maand" || text == "Maand" || text == "maand"){
    date = new Date();
    date.setDate(date.getDate() + 30);
  }else{
    text = text.replace(/-/g,"/");
    split = text.split('/');
    if(typeof split[1] != "undefined" && typeof split[2] != "undefined"){
      text = split[1]+'/'+split[0]+'/'+split[2];
    }
    text = text.replace("maa","mar");
    text = text.replace("mei","may");
    text = text.replace("okt","oct");
    date = new Date(Date.parse(text));
    date.setDate(date.getDate() + 1);
  }
  current_date= new Date(Date.parse(current_date.toDateString()));
  if(date != "Invalid Date" && date.getTime()>=current_date.getTime()){
    return date;
  }else{
    return false;
  }
};

var addSpaces = function(numberOfSpaces){
  var spaces = "";
  for(i=0; i<numberOfSpaces;i++){
    spaces+=" ";
  }
  return spaces;
};

var verifyUserName = function(input){
  var patern = /<@.{9}>/;
  var userid = patern.exec(input);
  if(userid){
    userid = userid[0].substr(2,9);
  }
  return userid;
};

var verifyChannelName = function(input){
  var patern = /<#.{9}>/;
  var channelid = patern.exec(input);
  if(channelid){
    channelid = channelid[0].substr(2,9);
  }
  return channelid;
};

var verifyUserId = function(input){
  var patern = /U.{8}/;
  var userid = patern.exec(input);
  if(userid){
    return userid[0];
  }else{
    return false;
  }
};

var verifyChannelId = function(input){
  var patern = /C.{8}/;
  var channelid = patern.exec(input);
  if(channelid){
    return channelid[0];
  }else{
    return false;
  }
};

module.exports = {
  formatUptime: formatUptime,
  verifyDate: verifyDate,
  addSpaces: addSpaces,
  verifyUserId: verifyUserId,
  verifyChannelId: verifyChannelId,
  verifyUserName: verifyUserName,
  verifyChannelName: verifyChannelName
};
@@ -689,41 +689,8 @@
 te;%0A
-  var current_date;%0A  var split;%0A
   if
@@ -1204,16 +1204,234 @@
 else%7B%0A  
+  date = parseDate(text);%0A  %7D%0A  var current_date= new Date();%0A  if(date != %22Invalid Date%22 && date.getTime()%3E=current_date.getTime())%7B%0A    return date;%0A  %7Delse%7B%0A    return false;%0A  %7D%0A%7D;%0A%0Avar parseDate = function(text)%7B%0A
   text =
@@ -1457,17 +1457,19 @@
 %22/%22);%0A  
- 
+var
  split =
@@ -1486,18 +1486,16 @@
 t('/');%0A
-  
   if(typ
@@ -1562,18 +1562,16 @@
 %22)%7B%0A    
-  
 text = s
@@ -1605,26 +1605,22 @@
 lit%5B2%5D;%0A
-  
   %7D%0A  
- 
- 
 text = t
@@ -1641,26 +1641,24 @@
 aa%22,%22mar%22);%0A
-  
   text = tex
@@ -1681,18 +1681,16 @@
 %22may%22);%0A
-  
   text =
@@ -1715,25 +1715,27 @@
 %22,%22oct%22);%0A  
- 
+var
  date = new 
@@ -1756,26 +1756,24 @@
 e(text));%0A  
- 
- 
 date.setDate
@@ -1800,199 +1800,22 @@
 ;%0A  
-%7D%0A  current_date= new Date(Date.parse(current_date.toDateString()));%0A  if(date != %22Invalid Date%22 && date.getTime()%3E=current_date.getTime())%7B%0A    return date;%0A  %7Delse%7B%0A    return false;%0A  %7D%0A%7D;
+return date;%0A%7D
 %0A%0Ava
@@ -2899,8 +2899,9 @@
 lName%0A%7D;
+%0A

split out new parseDate function and simplify verifydate