Skip to content
Snippets Groups Projects
Commit 973d2b89 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Check if reference date is DateTime.MinValue.

In this case return "never" instead of calculating the delta.

Refers to #25
parent b1907025
No related branches found
No related tags found
No related merge requests found
......@@ -124,6 +124,9 @@ namespace ATxCommon
/// <param name="refDate">The reference DateTime to check.</param>
/// <returns>A string describing the delta, e.g. "12 days" or "3 weeks".</returns>
public static string HumanSince(DateTime refDate) {
if (refDate == DateTime.MinValue) {
return "never, reference is DateTime.MinValue";
}
return SecondsToHuman(SecondsSince(refDate));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment