Merge pull request #390 from JohnsonNicholas/date_count

added date DaysSinceStart property
This commit is contained in:
Jesse Plamondon-Willard 2017-11-26 14:23:16 -05:00 committed by GitHub
commit 60d3ed9d5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -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
****/