The
calculation can be done as follows:
Set
V[date1] "&V[today_m/d/y]"
// in date1: any date in valid date format d.m.y, m/d/y, m-d-y,
y.m.d, y/m/d, y-m-d
// out date2: next working day (no Saturday or Sunday) in same format
Set
V[absdate] &V[date1] * 1
Set
V[day_of_week] &V[absdate] / 7 decimals=0
Set
V[day_of_week] &V[day_of_week] * 7
Set
V[day_of_week] &V[absdate] - &V[day_of_week]
// day_of_week: -3 = Friday -2=Saturday -1=Sunday ... 3=Thursday
// Friday?
if
V[day_of_week=-3]
Set V[date2] &V[date1] + 3
else
// Saturday?
if V[day_of_week=-2]
Set V[date2] &V[date1] + 2
else
Set V[date2] &V[date1] + 1
endif
endif
Message
"&V[date1], next working day: &V[date2]"
|