public override bool IsPeselValid(string pesel) { var date = DuchPeselUtils.PeselDateMagic(CutOffDate(pesel)); var dateModificationValues = _peselDateFactory.GetInstance(date[1]); if (dateModificationValues == null) { return(false); } date[0] += dateModificationValues[0]; date[1] -= dateModificationValues[1]; return(DuchPeselUtils.IsPeselLenghtValid(pesel) && Checksum(pesel) && ValidateDate(date[0], date[1], date[2])); }
protected override bool ValidateDate(int year, int month, int day) { return(DuchPeselUtils.IsMonthLenghtValid(month) && DuchPeselUtils.IsDayAmountValid(day) && TypowyAdamPeselValidatorUtils.IsDayValid(year, month, day)); }