public object Convert(object value, Type targetType, object parameter, string language) { if (value == null) { return(null); } DateTime dt = DateTime.Parse(value.ToString()); return(GlobalHelper.ConvertDateToTimeAgoFormat(dt)); }
public object Convert(object value, Type targetType, object parameter, string language) { Issue issue = (Issue)value; switch (issue.State) { case ItemState.Open: return($"#{issue.Number} opened by {issue.User.Login} {GlobalHelper.ConvertDateToTimeAgoFormat(DateTime.Parse(issue.CreatedAt.ToString()))}"); case ItemState.Closed: return($"#{issue.Number} by {issue.User.Login} was closed {GlobalHelper.ConvertDateToTimeAgoFormat(DateTime.Parse(issue.CreatedAt.ToString()))}"); } return(string.Empty); }
public object Convert(object value, Type targetType, object parameter, string language) { PullRequest pr = (PullRequest)value; switch (pr.State) { case ItemState.Open: return($"#{pr.Number} opened by {pr.User.Login} {GlobalHelper.ConvertDateToTimeAgoFormat(DateTime.Parse(pr.CreatedAt.ToString()))}"); case ItemState.Closed: return($"#{pr.Number} by {pr.User.Login} was merged {GlobalHelper.ConvertDateToTimeAgoFormat(DateTime.Parse(pr.CreatedAt.ToString()))}"); } return(string.Empty); }