summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2017-11-26 14:23:16 -0500
committerGitHub <noreply@github.com>2017-11-26 14:23:16 -0500
commit60d3ed9d5a11075f51285284e77b642b1d6790bc (patch)
treed560b4ec155ed0ed44a84e950746ecdf086be490 /src
parenta6071feaf84518c436fba0d148e3ea7d547663da (diff)
parent4aa3545b58ccda79863d8d2136904f2ff0995cfb (diff)
downloadSMAPI-60d3ed9d5a11075f51285284e77b642b1d6790bc.tar.gz
SMAPI-60d3ed9d5a11075f51285284e77b642b1d6790bc.tar.bz2
SMAPI-60d3ed9d5a11075f51285284e77b642b1d6790bc.zip
Merge pull request #390 from JohnsonNicholas/date_count
added date DaysSinceStart property
Diffstat (limited to 'src')
-rw-r--r--src/SMAPI/Utilities/SDate.cs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/SMAPI/Utilities/SDate.cs b/src/SMAPI/Utilities/SDate.cs
index 2630731a..126673eb 100644
--- a/src/SMAPI/Utilities/SDate.cs
+++ b/src/SMAPI/Utilities/SDate.cs
@@ -95,6 +95,12 @@ namespace StardewModdingAPI.Utilities
return $"{this.Day:00} {this.Season} Y{this.Year}";
}
+ /// <summary>This function will return the number of days since Year 1 Spring 0 for an arbitrary date</summary>
+ public static int TotalNumberOfDays(SDate date)
+ {
+ return (((date.Year - 1) * 112) + (date.GetSeasonIndex() * 28) + date.Day);
+ }
+
/****
** IEquatable
****/