function [x,outofrange] = mydateindex(this,dates)
% MYDATEINDEX [Not a public function] Check user dates against plan range.
%
% Backend IRIS function.
% No help provided.

% -IRIS Toolbox.
% -Copyright (c) 2007-2012 Jaromir Benes.

%**************************************************************************

nper = round(this.enddate - this.startdate + 1);
x = round(dates - this.startdate + 1);
outofrangeindex = x < 1 | x > nper;
outofrange = dates(outofrangeindex);
x(outofrangeindex) = NaN;

end