fixed the trial end method to return formatted date when required