A simple, readable, and fast method would be to loop through the dates in date1, find the closest date in date2, and then replace that date in date2 with NaT so it won't be chosen again. That's what this demo does.
Inputs: two row vectors of dates in datetime format: dates1 & dates2
Outputs: nearestIdx(j) is the closest non-repeated date in date2 to date1(j); m is a nx2 matrix of paired dates.
See inline comments for details.
dates1 = datetime(2019,1,1)+days(sort(randi(364,1,100)));
dates2 = datetime(2018,12,28)+days(sort(randi(364,1,100)));
nearestIdx = nan(size(dates1));
dates2Temp = dates2;
for i = 1:numel(dates1)
[~, nearestIdx(i)] = min(abs(dates2Temp - dates1(i)));
dates2Temp(nearestIdx(i)) = NaT;
assert(numel(unique(nearestIdx))==numel(dates1),'Sanity check failure: unique date matching error.')
m = [dates1.', dates2(nearestIdx).']