I have a situation where user define the weekday for delivery and its transit day. When the estimate to arrival(ETA) date is given, I need to calculate the estimate to delivery (ETD) date base on the transit day.
Example:
ETA is 17/Jul/2013, Transit Day: 10 Days, Delivery Day: Tue / Fri
By using AddDays(-10)
, the ETD would be 8/Jul/2013 (Mon)
. Due to delivery day is not drop on Tue
or Fri
, system need to look backward the calendar.
As result, system must take the 5/Jul (Fri)
as ETD
date.
What is the best practice to archive this request?