Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
namespace Common;

using System.Diagnostics.Eventing.Reader;
using System.Globalization;
using System.Reflection.Metadata;

public static class ValidationHelper
{

private static readonly string[] DateFormats = ["yyyyMMdd", "yyyyMM", "yyyy", "yyyy-MM-dd", "dd/MM/yyyy HH:mm:ss", "d/MM/yyyy hh:mm:ss tt", "dd/MM/yyyy HH:mm:ss tt", "yyyy"];
private static readonly string[] DateFormats = ["yyyyMMdd", "yyyyMM", "yyyy", "yyyy-MM-dd", "dd/MM/yyyy HH:mm:ss", "d/MM/yyyy hh:mm:ss tt", "dd/MM/yyyy HH:mm:ss tt"];
private static readonly string NilReturnFileNhsNumber = "0000000000";
// Validates that the date is not in the future and that it is in one of the expected formats
public static bool ValidatePastDate(string dateString)
Expand All @@ -19,11 +17,7 @@ public static bool ValidatePastDate(string dateString)
}
return false;
}
public static bool IsValidDate(string dateString)
{
var date = ParseDate(dateString);
return date.HasValue;
}

public static bool ValidateNHSNumber(string nhsNumber)
{
// Check the NHS number is a number
Expand Down