Skip to content

Commit

Permalink
Merge pull request #865 from maxkoshevoi/mk/date
Browse files Browse the repository at this point in the history
Add max date check in `IsValidExcelDate`
  • Loading branch information
tonyqus committed Jun 29, 2022
2 parents 88a5e97 + 2ffd3db commit afbfabf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main/SS/UserModel/DateUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,9 @@ public static bool IsCellInternalDateFormatted(ICell cell)
public static bool IsValidExcelDate(double value)
{
//return true;
return value > -Double.Epsilon;

const int maxDate = 2958465; // 31/12/9999
return value > -Double.Epsilon && value <= maxDate;
}

}
Expand Down

0 comments on commit afbfabf

Please sign in to comment.