text: var debug=require('debug')('date');
  
  exports.init=function(config, app)
  {
  	app.use(function(cmd, context, fileName, callback, next)
  	{
  		var text=cmd.text;
  		var timeStart=cmd.timeStart || 0;
  		var relativeTimes=[];
  		
  		relativeTimes=relativeTimes.concat($.map($.grep(Date.getLocale().modifiers, function(item){
  			return text.indexOf(item.src,timeStart)>=0;
  		}), function(item){ return item.src; }));
  		relativeTimes=relativeTimes.concat($.grep(Date.getLocale().months, function(item){
  			return text.indexOf(item,timeStart)>=0;
  		}));
  		relativeTimes=relativeTimes.concat($.grep(Date.getLocale().units, function(item){
  			return text.indexOf(item,timeStart)>=0;
  		}));
  
  		relativeTimes=relativeTimes.concat($.grep(Date.getLocale().weekdays, function(item){
  			return text.indexOf(item,timeStart)>=0;
  		}));
  		relativeTimes=relativeTimes.concat($.grep(Date.getLocale().tokens, function(item){
  			return text.indexOf(item,timeStart)>=0;
  		}));
  		if(text.indexOf(Date.getLocale().timeMarker, timeStart)>-1)
  			relativeTimes=relativeTimes.concat(Date.getLocale().timeMarker);
  
  		debug($('util').inspect(relativeTimes));
  
  		var relativeTime=$.grep($.map(relativeTimes, function(relativeTime){
  			return text.indexOf(relativeTime, timeStart)
  		}), function(item){ return item>=timeStart }).sort(function(a,b){ return a-b;}).unique();
  
  		if(relativeTime.length==0)
  			return next();
  
  		debug(relativeTime);
  		
  		var timeEnd=1;
  		while(!cmd.time || relativeTime.length>=1)
  		{
  			timeEnd=relativeTime[relativeTime.length-1];
  			if(text.indexOf(Date.getLocale().timeMarker, timeStart)==timeEnd)
  				timeEnd=text.indexOf(' ', text.indexOf(' ', timeEnd)+1)+1;
  			else
  				timeEnd=text.indexOf(' ', timeEnd)+1;
  
  			if(relativeTime.length<2 || timeEnd==0)
  				timeEnd=text.length+1;
  			timeStart=relativeTime[0];
  
  			debug(timeStart+','+timeEnd);
  			
  			var time=text.substring(timeStart, timeEnd-1).trim();
  			debug(time);
  			cmd.timeStart=timeStart;
  			cmd.timeEnd=timeEnd;
  			cmd.time=Date.create(time.replace(/h([0-5][0-9])/, ':$1'));
  			if(cmd.time.isValid())
  				break;
  			if(relativeTime.length==1)
  			{
  				cmd.time=Date.create('aujourd\'hui '+time.replace(/h([0-5][0-9])/, ':$1'));				
  				if(cmd.time.isValid())
  					break;
  			}
  			relativeTime.pop();
  		}
  		if(!cmd.time.isValid() && time!='' && typeof(time)!='undefined')
  		{
  			debug('new start');
  			debug(time);
  			debug('not understood');
  			cmd.timeStart++;
  
  			return arguments.callee.apply(this, arguments);
  		}
  		cmd.text=text.substring(0,timeStart)+text.substring(timeEnd);
  		debug(cmd.time);
  		if(!cmd.time.isFuture())
  		{
  			return next('je ne peux pas remonter le temps');
  		}
  		cmd.deferred=true;
  		next();
  		if(cmd.deferred)
  		{
              cmd.deferred=false;
              var timer=setTimeout(next, cmd.time.millisecondsFromNow())
              process.on('exit', function(){
                  clearTimeout(timer);
              });
              callback(null, "ok, je m'en charge "+ cmd.time.relative());
  		}
  	});
  };