mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-27 14:30:56 +00:00
Add single day tolerance to end of appearance period
This commit is contained in:
parent
26e0f31c95
commit
e6a60ec210
1 changed files with 6 additions and 2 deletions
|
@ -44,11 +44,15 @@ namespace PKHeX.Core
|
|||
|
||||
public bool IsWithinStartEnd(int stamp)
|
||||
{
|
||||
// Events are in UTC, but time zones exist (and delayed captures too).
|
||||
// Allow an extra day past the end date.
|
||||
const int tolerance = 1;
|
||||
|
||||
if (End == 0)
|
||||
return Start <= stamp;
|
||||
if (Start == 0)
|
||||
return stamp <= End;
|
||||
return Start <= stamp && stamp <= End;
|
||||
return stamp <= End + tolerance;
|
||||
return Start <= stamp && stamp <= End + tolerance;
|
||||
}
|
||||
|
||||
public static int GetTimeStamp(int y, int m, int d) => (y << 16) | (m << 8) | d;
|
||||
|
|
Loading…
Reference in a new issue