Skip to content

Commit 4367f91

Browse files
committed
Date error message update
1 parent 217f32b commit 4367f91

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

LearningHub.Nhs.WebUI/Models/Report/ReportCreationDateSelection.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,18 @@ private void ValidateStartDateIsAfterDataStart(List<ValidationResult> startDateV
186186
{
187187
startDateValidationResults.Add(
188188
new ValidationResult(
189-
"Enter a start date after the start of data in the platform", new[] { nameof(this.StartDay), }));
189+
$"No data is available for the selected date range. Select a date after {this.DataStart.Value.Day} {this.DataStart.Value.Month} {this.DataStart.Value.Year}", new[] { nameof(this.StartDay), }));
190+
startDateValidationResults.Add(
191+
new ValidationResult(
192+
string.Empty,
193+
new[] { nameof(this.StartMonth), nameof(this.StartYear), }));
194+
}
195+
196+
if (startDate.Date > DateTime.Now.Date)
197+
{
198+
startDateValidationResults.Add(
199+
new ValidationResult(
200+
"The start date cannot be in the future", new[] { nameof(this.StartDay), }));
190201
startDateValidationResults.Add(
191202
new ValidationResult(
192203
string.Empty,

0 commit comments

Comments
 (0)