mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
code_style: remove unused code
This commit is contained in:
parent
1eb77a5e49
commit
f9c8e4c699
1 changed files with 0 additions and 32 deletions
|
@ -25,37 +25,5 @@ namespace SourceGit.Models
|
||||||
|
|
||||||
public bool IsCommitterVisible => !Author.Equals(Committer) || AuthorTime != CommitterTime;
|
public bool IsCommitterVisible => !Author.Equals(Committer) || AuthorTime != CommitterTime;
|
||||||
public bool IsCurrentHead => Decorators.Find(x => x.Type is DecoratorType.CurrentBranchHead or DecoratorType.CurrentCommitHead) != null;
|
public bool IsCurrentHead => Decorators.Find(x => x.Type is DecoratorType.CurrentBranchHead or DecoratorType.CurrentCommitHead) != null;
|
||||||
|
|
||||||
public string CommitterTimeFromNowString
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
var today = DateTime.Today;
|
|
||||||
var committerTime = DateTime.UnixEpoch.AddSeconds(CommitterTime).ToLocalTime();
|
|
||||||
|
|
||||||
if (committerTime >= today)
|
|
||||||
{
|
|
||||||
var now = DateTime.Now;
|
|
||||||
var timespan = now - committerTime;
|
|
||||||
if (timespan.TotalHours > 1)
|
|
||||||
return $"{(int)timespan.TotalHours} hours ago";
|
|
||||||
|
|
||||||
return timespan.TotalMinutes < 1 ? "Just now" : $"{(int)timespan.TotalMinutes} minutes ago";
|
|
||||||
}
|
|
||||||
|
|
||||||
var diffYear = today.Year - committerTime.Year;
|
|
||||||
if (diffYear == 0)
|
|
||||||
{
|
|
||||||
var diffMonth = today.Month - committerTime.Month;
|
|
||||||
if (diffMonth > 0)
|
|
||||||
return diffMonth == 1 ? "Last month" : $"{diffMonth} months ago";
|
|
||||||
|
|
||||||
var diffDay = today.Day - committerTime.Day;
|
|
||||||
return diffDay == 1 ? "Yesterday" : $"{diffDay} days ago";
|
|
||||||
}
|
|
||||||
|
|
||||||
return diffYear == 1 ? "Last year" : $"{diffYear} years ago";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue