%% Shift to Weekday
% Create a datetime array. Format it to display day of the week and the date.

t = [datetime(2021,5,30) datetime(2021,6,4)];
t.Format = 'eeee, dd MMM yyyy'

%
% Shift to the first weekday that occurs on or after each value in t. Sunday shifts to Monday. But because Friday is already a weekday, the second datetime value is not shifted.

t2 = dateshift(t,'dayofweek','weekday')

% Copyright 2021 The MathWorks, Inc.