Remaining time estimate

This commit is contained in:
2017-02-03 22:26:00 -05:00
parent 77a35e87d3
commit b4440ecd95
27 changed files with 3579 additions and 550 deletions
+2
View File
@@ -25,6 +25,8 @@ namespace LeafWeb.Core.Utility
{
Func<int, string> pluralize = i => i > 1 ? "s" : string.Empty;
Func<int, string, string> formatTime = (i, s) => $"{i:0} {s}{pluralize(i)}";
if (span.Duration().Days > 90)
return formatTime(span.Days/30, "month");
if (span.Duration().Days > 0)
return formatTime(span.Days, "day");
if (span.Duration().Hours > 0)