See if this does the job:
this.Duration.content = this.LastActivityDate.Delta(Context.GetCurrentUserDate()).ConvertToDays();
this.Duration.unitCode = "DAY";
See if this does the job:
this.Duration.content = this.LastActivityDate.Delta(Context.GetCurrentUserDate()).ConvertToDays();
this.Duration.unitCode = "DAY";