Calculate a deadline based on the currect date, a due date and a time span as follows:
Due date in past
deadline: create date.
Due date in greater than 72h from current date.
timespan gt 0: current date + time span.
timespan lt 0: due date + timespan.
Due date is less than 72h from current date.
timespan gt 0: current date + (due date - current date)/3.
timespan lt 0: due date - (due date - current date)/3*2.
Due date missing:
timespan gt 0: current date + time span.
timespan lt 0: no deadline.
Namespace: Scanjour.Workflow4.ActivityLibrary.ServiceProcess
Assembly: Scanjour.Workflow4.ActivityLibrary_21.3.0.0 (in Scanjour.Workflow4.ActivityLibrary_21.3.0.0.dll) Version: 21.3.0.0 (21.3.0.0)
Syntax
public static DateTime CalculateDeadline( DateTime currentDate, DateTime dueDate, TimeSpan span, bool atNoon = false )
Parameters
- currentDate
- Type: SystemDateTime
The current date. - dueDate
- Type: SystemDateTime
The due date. - span
- Type: SystemTimeSpan
The time span defined. - atNoon (Optional)
- Type: SystemBoolean
True if deadline should be at noon, default false
Return Value
Type: DateTimeThe new deadline.
See Also