-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
020f5ac
commit 2c239a4
Showing
25 changed files
with
520 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
<local:MainWindowViewModel xmlns:local="clr-namespace:GG"> | ||
<local:MainWindowViewModel.Repositories> | ||
<local:Repository Name="Sample" FullPath="Z:/www/git1"> | ||
<local:Repository.Commits> | ||
<local:Commit AuthorEmail="foo@email" AuthorName="Foo" Date="12.12.2012" Description="Foo" Hash="123" Source="asdasd" /> | ||
<local:Commit AuthorEmail="foo@email" AuthorName="Foo" Date="12.12.2012" Description="Foo 2" Hash="456" Source="asdasd" /> | ||
<local:Commit AuthorEmail="foo@email" AuthorName="Foo" Date="12.12.2012" Description="Foo 3 " Hash="789" Source="asdasd" /> | ||
</local:Repository.Commits> | ||
</local:Repository> | ||
</local:MainWindowViewModel.Repositories> | ||
<local:MainWindowViewModel.RepositoryViewModels> | ||
<local:RepositoryViewModel Name="Sample" FullPath="Z:/www/git1"> | ||
<local:RepositoryViewModel.Commits> | ||
<local:Commit AuthorEmail="foo@email" AuthorName="Foo" Date="12.12.2012" FormattedDate="One minute ago" Description="Foo" Hash="123" Source="asdasd" /> | ||
<local:Commit AuthorEmail="foo@email" AuthorName="Foo" Date="12.12.2012" FormattedDate="5 minutes ago" Description="Foo 2" Hash="456" Source="asdasd" /> | ||
<local:Commit AuthorEmail="foo@email" AuthorName="Foo" Date="12.12.2012" FormattedDate="6 hours ago" Description="Foo 3 " Hash="789" Source="asdasd" /> | ||
</local:RepositoryViewModel.Commits> | ||
</local:RepositoryViewModel> | ||
<local:RepositoryViewModel Name="New Tab" NotOpened="True"> | ||
<local:RepositoryViewModel.Commits> | ||
</local:RepositoryViewModel.Commits> | ||
</local:RepositoryViewModel> | ||
</local:MainWindowViewModel.RepositoryViewModels> | ||
|
||
<local:MainWindowViewModel.RecentRepositories> | ||
<local:RepositoryViewModel Name="Sample" FullPath="Z:/www/git1" /> | ||
</local:MainWindowViewModel.RecentRepositories> | ||
</local:MainWindowViewModel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
using System; | ||
|
||
namespace GG.Libraries | ||
{ | ||
public class DateUtil | ||
{ | ||
/// <summary> | ||
/// Converts a DateTime object into a relative time string. | ||
/// </summary> | ||
/// <param name="dt"></param> | ||
/// <returns></returns> | ||
public static string GetRelativeDate(DateTime dt) | ||
{ | ||
var ts = new TimeSpan(DateTime.UtcNow.Ticks - dt.Ticks); | ||
double delta = Math.Abs(ts.TotalSeconds); | ||
|
||
const int SECOND = 1; | ||
const int MINUTE = 60 * SECOND; | ||
const int HOUR = 60 * MINUTE; | ||
const int DAY = 24 * HOUR; | ||
const int MONTH = 30 * DAY; | ||
|
||
if (delta < 2 * MINUTE) | ||
{ | ||
return "One minute ago"; | ||
} | ||
|
||
if (delta < 45 * MINUTE) | ||
{ | ||
return ts.Minutes + " minutes ago"; | ||
} | ||
|
||
if (delta < 90 * MINUTE) | ||
{ | ||
return "An hour ago"; | ||
} | ||
|
||
if (delta < 48 * HOUR) | ||
{ | ||
return ts.Hours + " hours ago"; | ||
} | ||
|
||
if (delta < 7 * DAY) | ||
{ | ||
return ts.Days + " days ago"; | ||
} | ||
|
||
return dt.ToShortDateString() + ' ' + dt.ToShortTimeString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using GG.Libraries; | ||
|
||
namespace GG | ||
{ | ||
public class StatusItem | ||
{ | ||
public string Status { set; get; } | ||
public string Filename { set; get; } | ||
public string Type { set; get; } | ||
public string Size { set; get; } | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.