DifferenceInDays.cs
namespace WeekOfDay
{
public static class DifferenceInDays
{
public static string GetDifference(DateTime targetDay)
{
var today = DateTime.Today;
TimeSpan difference = today - targetDay;
var str = "dddddd";
return (today > targetDay) ? difference.ToString(str) + "日前"
: (today == targetDay) ? "同日です"
: difference.ToString(str) + "日後";
}
}
}